XmlRpc/Server/Fault.php
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 [email protected] 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
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


string $_encoding = 'UTF-8'
'UTF-8'
Details- Type
- string
- Inherited_from
- \Zend_XmlRpc_Fault::$$_encoding


array $_faultExceptionClasses = array('Zend_XmlRpc_Server_Exception' => true)
array('Zend_XmlRpc_Server_Exception' => true)
Details- Type
- array


array $_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')
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')
Details- Type
- array
- Inherited_from
- \Zend_XmlRpc_Fault::$$_internal
Methods


__construct(\Exception $e) : \Zend_XmlRpc_Server_Fault
Constructor
Name | Type | Description |
---|---|---|
$e | \Exception |
Type | Description |
---|---|
\Zend_XmlRpc_Server_Fault |


attachFaultException(string | array $classes) : void
Attach valid exceptions that can be used to define xmlrpc faults
Name | Type | Description |
---|---|---|
$classes | string | array | Class name or array of class names |


attachObserver(string $class) : boolean
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.
Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
boolean |


detachFaultException(string | array $classes) : void
Detach fault exception classes
Name | Type | Description |
---|---|---|
$classes | string | array | Class name or array of class names |


detachObserver(string $class) : boolean
Detach an observer
Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
boolean |


getException() : \Exception
Retrieve the exception
Type | Description |
---|---|
\Exception |
- Access
- public


getInstance(\Exception $e) : \Zend_XmlRpc_Server_Fault
Return Zend_XmlRpc_Server_Fault instance
Name | Type | Description |
---|---|---|
$e | \Exception |
Type | Description |
---|---|
\Zend_XmlRpc_Server_Fault |


isFault(string $xml) : boolean
Determine if an XML response is an XMLRPC fault
Inherited from: \Zend_XmlRpc_Fault::isFault()Name | Type | Description |
---|---|---|
$xml | string |
Type | Description |
---|---|
boolean |


loadXml(string $fault) : boolean
Name | Type | Description |
---|---|---|
$fault | string |
Type | Description |
---|---|
boolean | Returns true if successfully loaded fault response, false if response was not a fault response |
Exception | Description |
---|---|
\Zend_XmlRpc_Exception | if no or faulty XML provided, or if fault response does not contain either code or message |


setCode(int $code) : \Zend_XmlRpc_Fault
Name | Type | Description |
---|---|---|
$code | int |
Type | Description |
---|---|
\Zend_XmlRpc_Fault |


setEncoding(string $encoding) : \Zend_XmlRpc_Fault
Name | Type | Description |
---|---|---|
$encoding | string |
Type | Description |
---|---|
\Zend_XmlRpc_Fault |


setMessage( $message) : \Zend_XmlRpc_Fault
Name | Type | Description |
---|---|---|
$message | string |
Type | Description |
---|---|
\Zend_XmlRpc_Fault |