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.

category Zend
package Zend_XmlRpc
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructor

__construct($code = 404, $message = '') : \Zend_XmlRpc_Fault

Parameters

$code

$message

Returns

\Zend_XmlRpc_Fault

Return XML fault response

__toString() : string

Returns

string

Return fault code

getCode() : integer

Returns

integer

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) : boolean
Static

Parameters

$xml

string

Returns

boolean

Load an XMLRPC fault from XML

loadXml(string $fault) : boolean

Parameters

$fault

string

Exceptions

\Zend_XmlRpc_Exception if no or faulty XML provided, or if fault response does not contain either code or message

Returns

booleanReturns 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(integer $code) : \Zend_XmlRpc_Fault

Parameters

$code

integer

Returns

\Zend_XmlRpc_Fault

Set encoding to use in fault response

setEncoding(string $encoding) : \Zend_XmlRpc_Fault

Parameters

$encoding

string

Returns

\Zend_XmlRpc_Fault

Retrieve fault message

setMessage($message) : \Zend_XmlRpc_Fault

Parameters

$message

Returns

\Zend_XmlRpc_Fault

 Properties

 

Fault code

$_code : integer

Default

 

Fault character encoding

$_encoding : string

Default

'UTF-8'
 

Internal fault codes => messages

$_internal : array

Default

array(404 => 'Unknown Error', 610 => 'Invalid method class', 611 => 'Unable to attach function or callback; not callable', 612 => 'Unable to load array; not an array', 613 => 'One or more method records are corrupt or otherwise unusable', 620 => 'Method does not exist', 621 => 'Error instantiating class to invoke method', 622 => 'Method missing implementation', 623 => 'Calling parameters do not match signature', 630 => 'Unable to read request', 631 => 'Failed to parse request', 632 => 'Invalid request, no method passed; request must contain a \'methodName\' tag', 633 => 'Param must contain a value', 634 => 'Invalid method name', 635 => 'Invalid XML provided to request', 636 => 'Error creating xmlrpc value', 640 => 'Method does not exist', 650 => 'Invalid XML provided for response', 651 => 'Failed to parse response', 652 => 'Invalid response', 653 => 'Invalid XMLRPC value in response')
 

Fault message

$_message : string

Default