Methods

Create a new JSON-RPC client to a remote server.

__construct(string $server, \Zend\Http\Client $httpClient) 

Parameters

$server

string

Full address of the JSON-RPC service.

$httpClient

\Zend\Http\Client

HTTP Client to use for requests.

Send an JSON-RPC request to the service (for a specific method).

call(string $method, array $params) : mixed

Unified interface for calling custom remote methods.

Parameters

$method

string

Name of the method we want to call.

$params

array

Array of parameters for the method.

Exceptions

\Zend\Json\Server\Exception\ErrorException When remote call fails.

Returns

mixedMethod call results.

Perform an JSOC-RPC request and return a response.

doRequest(\Zend\Json\Server\Request $request) : \Zend\Json\Server\Response

Parameters

$request

\Zend\Json\Server\Request

Request.

Exceptions

\Zend\Json\Server\Exception\HttpException When HTTP communication fails.

Returns

Gets the HTTP client object.

getHttpClient() : \Zend\Http\Client

Returns

\Zend\Http\ClientHTTP client.

The request of the last method call.

getLastRequest() : \Zend\Json\Server\Request

Returns

\Zend\Json\Server\RequestRequest instance.

The response received from the last method call.

getLastResponse() : \Zend\Json\Server\Response

Returns

\Zend\Json\Server\ResponseResponse instance.

Sets the HTTP client object to use for connecting the JSON-RPC server.

setHttpClient(\Zend\Http\Client $httpClient) : \Zend\Json\Server\Client

Parameters

$httpClient

\Zend\Http\Client

New HTTP client to use.

Returns

Create request object.

createRequest(string $method, array $params) : \Zend\Json\Server\Request

Parameters

$method

string

Method to call.

$params

array

List of arguments.

Returns

\Zend\Json\Server\RequestCreated request.

 Properties

 

HTTP Client to use for requests.

$httpClient : \Zend\Http\Client

 

Request ID counter.

$id : int

 

Request of the last method call.

$lastRequest : \Zend\Json\Server\Request

 

Response received from the last method call.

$lastResponse : \Zend\Json\Server\Response

 

Full address of the JSON-RPC service.

$serverAddress : string