XmlRpc Response

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

package Default

 Methods

Constructor

__construct(mixed $return = null, string $type = null

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

null\Zend\XmlRpc\Fault

Retrieve the return value

getReturnValue() : mixed

Returns

mixed

Is the response a fault response?

isFault() : boolean

Returns

boolean

Load a response from an XML response

loadXml(string $response) : boolean

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

booleanTrue 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

\Zend\XmlRpc\Response

Set the return value

setReturnValue(mixed $value, string $type = null) : 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

Returns

\Zend\XmlRpc\AbstractValue

 Properties

 

Response character encoding

$encoding : string

Default

'UTF-8'
 

Fault, if response is a fault response

$fault : null | \Zend\XmlRpc\Fault

Default

null
 

Return value

$return : mixed

Default

 

Return type

$type : string

Default