XMLRPC Faults

Container for XMLRPC faults, containing both a code and a message; additionally, has methods for determining if an XML response is an XMLRPC fault, as well as generating the XML for an XMLRPC fault response.

To allow method chaining, you may only use the getInstance() factory to instantiate a Zend\XmlRpc\Server\Fault.

 Methods

Constructor

__construct($code, $message) 

Parameters

$code

$message

Return XML fault response

__toString() : string

Returns

string

Return fault code

getCode() : int

Returns

int

Retrieve current fault encoding

getEncoding() : string

Returns

string

Retrieve fault message

getMessage() : string

Returns

string

Determine if an XML response is an XMLRPC fault

isFault(string $xml) : bool

Parameters

$xml

string

Returns

bool

Load an XMLRPC fault from XML

loadXml(string $fault) : bool

Parameters

$fault

string

Exceptions

\Zend\XmlRpc\Exception\ExceptionInterface if no or faulty XML provided, or if fault response does not contain either code or message

Returns

boolReturns true if successfully loaded fault response, false if response was not a fault response

Serialize fault to XML

saveXml() : string

Returns

string

Set the fault code

setCode(int $code) : \Zend\XmlRpc\Fault

Parameters

$code

int

Returns

Set encoding to use in fault response

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

Parameters

$encoding

string

Returns

Retrieve fault message

setMessage($message) : \Zend\XmlRpc\Fault

Parameters

$message

string

Returns

 Properties

 

Fault code

$code : int

 

Fault character encoding

$encoding : string

 

Internal fault codes => messages

$internal : array

 

Fault message

$message : string