XmlRpc Response

Container for accessing an XMLRPC return value and creating the XML response.

 Methods

Constructor

__construct(mixed $return, string $type) 

Can optionally pass in the return value and type hinting; otherwise, the return value can be set via setReturnValue().

Parameters

$return

mixed

$type

string

Return XML response

__toString() : string

Returns

string

Retrieve current response encoding

getEncoding() : string

Returns

string

Returns the fault, if any.

getFault() : null | \Zend\XmlRpc\Fault

Returns

Retrieve the return value

getReturnValue() : mixed

Returns

mixed

Is the response a fault response?

isFault() : bool

Returns

bool

Load a response from an XML response

loadXml(string $response) : bool

Attempts to load a response from an XMLRPC response, autodetecting if it is a fault response.

Parameters

$response

string

Exceptions

\Zend\XmlRpc\Exception\ValueException if invalid XML

Returns

boolTrue if a valid XMLRPC response, false if a fault response or invalid input

Return response as XML

saveXml() : string

Returns

string

Set encoding to use in response

setEncoding(string $encoding) : \Zend\XmlRpc\Response

Parameters

$encoding

string

Returns

Set the return value

setReturnValue(mixed $value, string $type) : void

Sets the return value, with optional type hinting if provided.

Parameters

$value

mixed

$type

string

Retrieve the XMLRPC value for the return value

_getXmlRpcReturn() : \Zend\XmlRpc\AbstractValue

 Properties

 

Response character encoding

$encoding : string

 

Fault, if response is a fault response

$fault : null | \Zend\XmlRpc\Fault

 

Return value

$return : mixed

 

Return type

$type : string