Class 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);
| Method Summary |
|
static
void
|
create
( string $type, boolean $serverUrl, $isNotification)
Creates an instance of TJsonRpcClient
|
|
void
|
|
|
mixed
|
__call
( string $method, array $parameters)
|
| 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 | $type | url of the rpc server |
| boolean | $serverUrl | whether 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 | $method | method name |
| array | $parameters | method parameters |
| Output |
| Exception |
|
__call
| public mixed __call |
(string $method , array $parameters ) |
| Input |
| string | $method | RPC method name |
| array | $parameters | RPC method parameters |
| Output |
|
mixed
| RPC request result |
| Exception |
| throws | TRpcClientResponseException if the response represents an RPC fault |
| throws | TRpcClientRequestException if the client fails to connect to the server |
|
|