class RpcClient (View source)

Comodojo RPC client. It's able to talk in XML and JSON (2.0).

It optionally supports a not standard encrypted transport

Traits

Constants

JSONRPC

XMLRPC

Properties

static protected array $supported_protocols Supported RPC protocols from Protocol

Methods

setProtocol(string $protocol)

Set RPC protocol

from Protocol
string
getProtocol()

Get RPC protocol

from Protocol
setEncryption(string $key)

Set encryption key

string
getEncryption()

Get encryption key

setEncoding(string $encoding)

Set encoding (default to utf-8)

from Encoding
string
getEncoding()

Get encoding

from Encoding
__construct(string $server, LoggerInterface $logger = null, Transport $transport = null)

Class constructor

getTransport()

No description

getRequest()

No description

setAutoclean(bool $mode = true)

Set autoclean on/off

getAutoclean()

No description

addRequest(RpcRequest $request)

No description

getPayload(Processor $processor = null)

No description

mixed
send()

Send request(s) to server

Details

Protocol setProtocol(string $protocol)

Set RPC protocol

Parameters

string $protocol RPC protocol

Return Value

Protocol

Exceptions

Exception

string getProtocol()

Get RPC protocol

Return Value

string

Encryption setEncryption(string $key)

Set encryption key

This will enable the NOT-STANDARD payload encryption

Parameters

string $key Encryption key

Return Value

Encryption

Exceptions

Exception

string getEncryption()

Get encryption key

Return Value

string

Encoding setEncoding(string $encoding)

Set encoding (default to utf-8)

Parameters

string $encoding Characters encoding

Return Value

Encoding

string getEncoding()

Get encoding

Return Value

string

__construct(string $server, LoggerInterface $logger = null, Transport $transport = null)

Class constructor

Parameters

string $server Remote RPC server address
LoggerInterface $logger Logger interface
Transport $transport Transport Interface

Exceptions

InvalidArgumentException
Exception

getTransport()

getRequest()

RpcClient setAutoclean(bool $mode = true)

Set autoclean on/off

Parameters

bool $mode If true, requests will be removed from queue at each send()

Return Value

RpcClient

getAutoclean()

addRequest(RpcRequest $request)

Parameters

RpcRequest $request

getPayload(Processor $processor = null)

Parameters

Processor $processor

mixed send()

Send request(s) to server

Return Value

mixed

Exceptions

RpcException
HttpException
XmlrpcException
Exception