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 TJsonRpcClient

TComponent
   |
   --TApplicationComponent
      |
      --TRpcClient
         |
         --TJsonRpcClient

TJsonRpcClient class

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

Usage:

 $_rpcClient = new TJsonRpcClient('http://host/server');
 $_result = $_rpcClient->remoteMethod($param, $otherParam);
 // or
 $_result = TJsonRpcClient::create('http://host/server')->remoteMethod($param, $otherParam);

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

Method Summary
static  void
create ( string $type, boolean $serverUrl, $isNotification)
Creates an instance of TJsonRpcClient
void
encodeRequest ( string $method, array $parameters)
mixed
__call ( string $method, array $parameters)
Methods Inherited From TRpcClient
TRpcClient::create(), TRpcClient::createStreamContext(), TRpcClient::getIsNotification(), TRpcClient::getServerUrl(), TRpcClient::performRequest(), TRpcClient::setIsNotification(), TRpcClient::setServerUrl()
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()

Method Details

create

public static void create (string $type , boolean $serverUrl , $isNotification )

Creates an instance of TJsonRpcClient

Input
string$typeurl of the rpc server
boolean$serverUrlwhether the requests are considered to be notifications (completely ignoring the response) (default: false)
$isNotification
Output
Exception

encodeRequest

public void encodeRequest (string $method , array $parameters )

Input
string$methodmethod name
array$parametersmethod parameters
Output
Exception

__call

public mixed __call (string $method , array $parameters )

Input
string$methodRPC method name
array$parametersRPC method parameters
Output
mixed RPC request result
Exception
throwsTRpcClientResponseException if the response represents an RPC fault
throwsTRpcClientRequestException if the client fails to connect to the server