Packages:
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Javascripts
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Xml


Classes:
Keyword

Class TRpcClient

TComponent
   |
   --TApplicationComponent
      |
      --TRpcClient

Direct Known Sub-classes:

TRpcClient class

Note: When using setIsNotification(true), *every* following request is also considered to be a notification until you use setIsNotification(false).

Usage:

First, you can use the factory:

 $_rpcClient = TRpcClient::create('xml', 'http://host/server');
 $_result = $_rpcClient->remoteMethodName($param, $otherParam);

or as oneliner:

 $_result = TRpcClient::create('json', 'http://host/server')->remoteMethod($param, ...);

Second, you can also use the specific implementation directly:

 $_rpcClient = new TXmlRpcClient('http://host/server');
 $_result = $_rpcClient->remoteMethod($param, ...);

or as oneliner:

 $_result = TXmlRpcClient('http://host/server')->hello();

Author: Robin J. Rogge <rrogge@bigpoint.net>
Since: 3.2

Constructor Summary
public
__construct Array

Method Summary
static  TRpcClient
create ( $type, $serverUrl, $isNotification)
Creates an instance of the requested RPC client type
protected  void
createStreamContext ( mixed $content, string $contentType)
Creates a stream context resource
boolean
string
protected  void
performRequest ( string $serverUrl, array $payload, string $mimeType)
Performs the actual request
void
setIsNotification ( string $bool)
void
setServerUrl ( string $value)
Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
Methods Inherited From TComponent
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__call(), TComponent::__get(), TComponent::__set(), TComponent::__sleep(), TComponent::__wakeup()

Constructor Details

__construct

public __construct Array


Method Details

create

public static TRpcClient create ( $type , $serverUrl , $isNotification )

Creates an instance of the requested RPC client type

Input
$type
$serverUrl
$isNotification
Output
TRpcClient instance
Exception
throwsTApplicationException if an unsupported RPC client type was specified

createStreamContext

protected void createStreamContext (mixed $content , string $contentType )

Creates a stream context resource

Input
mixed$content
string$contentTypemime type
Output
Exception

getIsNotification

public boolean getIsNotification ()

Output
boolean whether requests are considered to be notifications (completely ignoring the response)
Exception

getServerUrl

public string getServerUrl ()

Output
string url of the RPC server
Exception

performRequest

protected void performRequest (string $serverUrl , array $payload , string $mimeType )

Performs the actual request

Input
string$serverUrlRPC server URL
array$payloadpayload data
string$mimeTyperequest mime type
Output
Exception

setIsNotification

public void setIsNotification (string $bool )

Input
string$boolboolean whether the requests are considered to be notifications (completely ignoring the response) (default: false)
Output
Exception

setServerUrl

public void setServerUrl (string $value )

Input
string$valueurl of the RPC server
Output
Exception