XmlRpc/Server/Fault.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_XmlRpc  
Subpackage
Server  
Version
$Id: Fault.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_XmlRpc_Server_Fault

Package: Zend\XmlRpc\Server
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 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 attachObserver(). Observers need only implement a static 'observe' method.

To allow method chaining, you may use the getInstance() factory to instantiate a Zend_XmlRpc_Server_Fault.

Parent(s)
\Zend_XmlRpc_Fault
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedint $_code
inherited
Fault code
Inherited from: \Zend_XmlRpc_Fault::$$_code
Details
Type
int
Inherited_from
\Zend_XmlRpc_Fault::$$_code  
>VPropertyprotectedstring $_encoding = 'UTF-8'
inherited
Fault character encoding
Inherited from: \Zend_XmlRpc_Fault::$$_encoding
Default value'UTF-8'Details
Type
string
Inherited_from
\Zend_XmlRpc_Fault::$$_encoding  
>VPropertyprotected\Exception $_exception
Details
Type
\Exception
>VPropertyprotectedarray $_faultExceptionClasses = array('Zend_XmlRpc_Server_Exception' => true)
static

Array of exception classes that may define xmlrpc faults

Default valuearray('Zend_XmlRpc_Server_Exception' => true)Details
Type
array
>VPropertyprotectedarray $_internal = 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')
inherited
Internal fault codes => messages
Inherited from: \Zend_XmlRpc_Fault::$$_internal
Default valuearray(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')Details
Type
array
Inherited_from
\Zend_XmlRpc_Fault::$$_internal  
>VPropertyprotectedstring $_message
inherited
Fault message
Inherited from: \Zend_XmlRpc_Fault::$$_message
Details
Type
string
Inherited_from
\Zend_XmlRpc_Fault::$$_message  
>VPropertyprotectedarray $_observers = array()
static

Array of fault observers

Default valuearray()Details
Type
array

Methods

methodpublic__construct(\Exception $e) : \Zend_XmlRpc_Server_Fault

Constructor

Parameters
NameTypeDescription
$e\Exception
Returns
TypeDescription
\Zend_XmlRpc_Server_Fault
methodpublic__toString() : string
inherited

Return XML fault response

Inherited from: \Zend_XmlRpc_Fault::__toString()
Returns
TypeDescription
string
methodpublicattachFaultException(string | array $classes) : void
static

Attach valid exceptions that can be used to define xmlrpc faults

Parameters
NameTypeDescription
$classesstring | array

Class name or array of class names

methodpublicattachObserver(string $class) : boolean
static

Attach an observer class

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
NameTypeDescription
$classstring
Returns
TypeDescription
boolean
methodpublicdetachFaultException(string | array $classes) : void
static

Detach fault exception classes

Parameters
NameTypeDescription
$classesstring | array

Class name or array of class names

methodpublicdetachObserver(string $class) : boolean
static

Detach an observer

Parameters
NameTypeDescription
$classstring
Returns
TypeDescription
boolean
methodpublicgetCode() : int
inherited

Return fault code

Inherited from: \Zend_XmlRpc_Fault::getCode()
Returns
TypeDescription
int
methodpublicgetEncoding() : string
inherited

Retrieve current fault encoding

Inherited from: \Zend_XmlRpc_Fault::getEncoding()
Returns
TypeDescription
string
methodpublicgetException() : \Exception

Retrieve the exception

Returns
TypeDescription
\Exception
Details
Access
public  
methodpublicgetInstance(\Exception $e) : \Zend_XmlRpc_Server_Fault
static

Return Zend_XmlRpc_Server_Fault instance

Parameters
NameTypeDescription
$e\Exception
Returns
TypeDescription
\Zend_XmlRpc_Server_Fault
methodpublicgetMessage() : string
inherited

Retrieve fault message

Inherited from: \Zend_XmlRpc_Fault::getMessage()
Returns
TypeDescription
string
methodpublicisFault(string $xml) : boolean
staticinherited

Determine if an XML response is an XMLRPC fault

Inherited from: \Zend_XmlRpc_Fault::isFault()
Parameters
NameTypeDescription
$xmlstring
Returns
TypeDescription
boolean
methodpublicloadXml(string $fault) : boolean
inherited

Load an XMLRPC fault from XML

Inherited from: \Zend_XmlRpc_Fault::loadXml()
Parameters
NameTypeDescription
$faultstring
Returns
TypeDescription
booleanReturns true if successfully loaded fault response, false if response was not a fault response
Throws
ExceptionDescription
\Zend_XmlRpc_Exceptionif no or faulty XML provided, or if fault response does not contain either code or message
methodpublicsaveXml() : string
inherited

Serialize fault to XML

Inherited from: \Zend_XmlRpc_Fault::saveXml()
Returns
TypeDescription
string
methodpublicsetCode(int $code) : \Zend_XmlRpc_Fault
inherited

Set the fault code

Inherited from: \Zend_XmlRpc_Fault::setCode()
Parameters
NameTypeDescription
$codeint
Returns
TypeDescription
\Zend_XmlRpc_Fault
methodpublicsetEncoding(string $encoding) : \Zend_XmlRpc_Fault
inherited

Set encoding to use in fault response

Inherited from: \Zend_XmlRpc_Fault::setEncoding()
Parameters
NameTypeDescription
$encodingstring
Returns
TypeDescription
\Zend_XmlRpc_Fault
methodpublicsetMessage(string $message) : \Zend_XmlRpc_Fault
inherited

Retrieve fault message

Inherited from: \Zend_XmlRpc_Fault::setMessage()
Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
\Zend_XmlRpc_Fault
Documentation was generated by phpDocumentor 2.0.0a12.