XMLRPC Server Faults

Encapsulates an exception for use as an XMLRPC fault response. Valid exception classes that may be used for generating the fault code and fault string can be attached using \Zend\XmlRpc\Server\attachFaultException(); all others use a generic '404 Unknown error' response.

You may also attach fault observers, which would allow you to monitor particular fault cases; this is done via \Zend\XmlRpc\Server\attachObserver(). Observers need only implement a static 'observe' method.

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

package Default
inherited_from \Zend\XmlRpc\Fault

 Methods

Constructor

__construct(\Exception $e) : \Zend\XmlRpc\Server\Fault
inherited_from \Zend\XmlRpc\Fault::__construct()

Parameters

$e

\Exception

Returns

\Zend\XmlRpc\Server\Fault

Constructor

__construct(integer $code = 404, string $message = ''
Inherited

Parameters

$code

integer

$message

string

Return XML fault response

__toString() : string
Inherited

Returns

string

Attach valid exceptions that can be used to define xmlrpc faults

attachFaultException(string|array $classes) : void
Static

Parameters

$classes

stringarray

Class name or array of class names

Attach an observer class

attachObserver(string $class) : boolean
Static

Allows observation of xmlrpc server faults, thus allowing logging or mail notification of fault responses on the xmlrpc server.

Expects a valid class name; that class must have a public static method 'observe' that accepts an exception as its sole argument.

Parameters

$class

string

Returns

boolean

Detach fault exception classes

detachFaultException(string|array $classes) : void
Static

Parameters

$classes

stringarray

Class name or array of class names

Detach an observer

detachObserver(string $class) : boolean
Static

Parameters

$class

string

Returns

boolean

Return fault code

getCode() : integer
Inherited

Returns

integer

Retrieve current fault encoding

getEncoding() : string
Inherited

Returns

string

Retrieve the exception

getException() : \Exception
access public

Returns

\Exception

Return Zend\XmlRpc\Server\Fault instance

getInstance(\Exception $e) : \Zend\XmlRpc\Server\Fault
Static

Parameters

$e

\Exception

Returns

\Zend\XmlRpc\Server\Fault

Retrieve fault message

getMessage() : string
Inherited

Returns

string

Determine if an XML response is an XMLRPC fault

isFault(string $xml) : boolean
InheritedStatic

Parameters

$xml

string

Returns

boolean

Load an XMLRPC fault from XML

loadXml(string $fault) : boolean
Inherited

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

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

Serialize fault to XML

saveXml() : string
Inherited

Returns

string

Set the fault code

setCode(integer $code) : \Zend\XmlRpc\Fault
Inherited

Parameters

$code

integer

Returns

\Zend\XmlRpc\Fault

Set encoding to use in fault response

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

Parameters

$encoding

string

Returns

\Zend\XmlRpc\Fault

Retrieve fault message

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

Parameters

$message

Returns

\Zend\XmlRpc\Fault

 Properties

 

Fault code

$code : integer

Default

 

Fault character encoding

$encoding : string

Default

'UTF-8'
 

$exception

$exception : \Exception

Default

 

Array of exception classes that may define xmlrpc faults

$faultExceptionClasses : array

Default

array('Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface' => true)
Static
 

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

 

Array of fault observers

$observers : array

Default

array()
Static