Class Zend_XmlRpc_Request

Description

XmlRpc Request object

Encapsulates an XmlRpc request, holding the method call and all parameters. Provides accessors for these, as well as the ability to load from XML and to create the XML request string.

Additionally, if errors occur setting the method or parsing XML, a fault is generated and stored in $_fault; developers may check for it using isFault() and getFault().

  • version: $Id: Request.php 20208 2010-01-11 22:37:37Z lars $
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /XmlRpc/Request.php (line 48)


	
			
Direct descendents
Class Description
 class Zend_XmlRpc_Request_Stdin XmlRpc Request object -- Request via STDIN
 class Zend_XmlRpc_Request_Http XmlRpc Request object -- Request via HTTP
Variable Summary
Method Summary
 Zend_XmlRpc_Request __construct ([string $method = null], [array $params = null])
 void addParam (mixed $value, [string $type = null])
 string getEncoding ()
 string getMethod ()
 array getParams ()
 array getTypes ()
 boolean isFault ()
 boolean loadXml (string $request)
 string saveXml ()
 Zend_XmlRpc_Request setEncoding (string $encoding)
 boolean setMethod (string $method)
 void setParams ()
 array _getXmlRpcParams ()
 string __toString ()
Variables
string $_encoding = 'UTF-8' (line 54)

Request character encoding

  • access: protected
Zend_XmlRpc_Fault $_fault = null (line 78)

Fault object, if any

  • access: protected
string $_method (line 60)

Method to call

  • access: protected
array $_params = array() (line 72)

Method parameters

  • access: protected
array $_types = array() (line 84)

XML-RPC type for each param

  • access: protected
string $_xml (line 66)

XML request

  • access: protected

Redefined in descendants as:
array $_xmlRpcParams = array() (line 90)

XML-RPC request params

  • access: protected
Methods
Constructor __construct (line 98)

Create a new XML-RPC request

  • access: public
Zend_XmlRpc_Request __construct ([string $method = null], [array $params = null])
  • string $method: (optional)
  • array $params: (optional)

Redefined in descendants as:
addParam (line 171)

Add a parameter to the parameter stack

Adds a parameter to the parameter stack, associating it with the type $type if provided

  • access: public
void addParam (mixed $value, [string $type = null])
  • mixed $value
  • string $type: Optional; type hinting
getEncoding (line 128)

Retrieve current request encoding

  • access: public
string getEncoding ()
getFault (line 372)

Retrieve the fault response, if any

  • access: public
null|Zend_XmlRpc_Fault getFault ()
getMethod (line 156)

Retrieve call method

  • access: public
string getMethod ()
getParams (line 277)

Retrieve the array of parameters

  • access: public
array getParams ()
getTypes (line 287)

Return parameter types

  • access: public
array getTypes ()
isFault (line 362)

Does the current request contain errors and should it return a fault response?

  • access: public
boolean isFault ()
loadXml (line 298)

Load XML and parse into request components

  • return: True on success, false if an error occurred.
  • access: public
boolean loadXml (string $request)
  • string $request
saveXml (line 405)

Create XML request

  • access: public
string saveXml ()
setEncoding (line 116)

Set encoding to use in request

  • access: public
Zend_XmlRpc_Request setEncoding (string $encoding)
  • string $encoding
setMethod (line 139)

Set method to call

  • return: Returns true on success, false if method name is invalid
  • access: public
boolean setMethod (string $method)
  • string $method
setParams (line 208)

Set the parameters array

If called with a single, array value, that array is used to set the parameters stack. If called with multiple values or a single non-array value, the arguments are used to set the parameters stack.

Best is to call with array of the format, in order to allow type hinting when creating the XMLRPC values for each parameter:

  1.  $array array(
  2.      array(
  3.          'value' => $value,
  4.          'type'  => $type
  5.      )[... ]
  6.  );

  • access: public
void setParams ()
_getXmlRpcParams (line 382)

Retrieve method parameters as XMLRPC values

  • access: protected
array _getXmlRpcParams ()
__toString (line 435)

Return XML request

  • access: public
string __toString ()

Documentation generated on Mon, 21 Jun 2010 15:42:07 -0400 by phpDocumentor 1.4.3