Class Zend_XmlRpc_Client

Description

An XML-RPC client implementation

Located in /Zend/XmlRpc/Client.php (line 52)


	
			
Class Constant Summary
 RESPONSE_PHP_NATIVE = 'php_native'
 RESPONSE_XML_STRING = 'xml_string'
 RESPONSE_ZXMLRPC_OBJECT = 'Zend_XmlRpc_Value_object'
Variable Summary
Method Summary
 Zend_XmlRpc_Client __construct (string $server, [string $methodsXml = null])
 string _buildMethodsXML (array $signatures)
 string _buildRequest (string $method, [array $params = null])
 array|null _convertParams (array &$params, [string $methodName = null])
 array _getMethodParams (string $methodName)
 array _getSignatures (array $methodNames)
 array _getSignaturesMultiCall (array $methodNames)
 void _parseResponse (string $response)
 void _sendRequest (string $method, [array $params = null])
 void __call (string $methodName, array $params)
 string __getMethodsXml ()
 mixed __getResponse ([Zend_XmlRpc_Client::RESPONSE_* $type = self::RESPONSE_PHP_NATIVE])
 void __setMethodsXml ([null|string $methodsXml = null])
 void __xmlrpcCall (string $methodName, varargs 1)
Variables
array $_methodSignatures = array() (line 93)

Holding all the method signatures, the array has the methods name as keys and the signature as the value

The signature is an array of 2 keys: 'return_value' - string, hold the return value of the method 'params' - array of strings, hold the parameters for the method (can be an empty array)

This array is created automatically when calling the __getMethodsXml() or __setMethodsXml() methods

  • access: protected
array $_namespaceDecorators = array() (line 80)

Array of cached namespace decorators, array of Zend_XmlRpc_Client_NamespaceDecorator objects

  • access: protected
Zend_XmlRpc_Value|null $_response = null (line 73)

The response from an XML-RPC method call, held in a Zend_XmlRpc_Value object

  • access: protected
string $_serverAddress (line 66)

The XML-RPC service server full address

  • access: protected
Methods
Constructor __construct (line 106)

Class constructor - create a new XML-RPC client to a remote server

  • access: public
Zend_XmlRpc_Client __construct (string $server, [string $methodsXml = null])
  • string $server: Full address of the XML-RPC service (e.g. http://time.xmlrpc.com/RPC2)
  • string $methodsXml: Method signatures in XML format, used for type hinting during the PHP->XMLRPC type conversions. {@see __getMethodsXml() for more information}
_buildMethodsXML (line 468)

Generates an XML string analogous to SOAP's WSDL representing all the methods signatures Signature is the method return value and method parameters This function also set the _methodSignatures data memeber with the method signatures details (in an array)

  • return: XML representing the signatures of all server methods, analogous to SOAP's WSDL file
  • access: protected
string _buildMethodsXML (array $signatures)
  • array $signatures: Array in the structure of method name => array (return value, parameters)
_buildRequest (line 322)

Build the XML body of an XML-RPC request

  • return: The XML body
  • access: protected
string _buildRequest (string $method, [array $params = null])
  • string $method: Name of the method we want to call
  • array $params: Array of Zend_XmlRpc_Value objects, parameters for the method
_convertParams (line 518)

Convert an array of PHP variables into XML-RPC native types represented by Zend_XmlRpc_Value objects If method name is given, try to use the _methodSignatures data member for type hinting, if not, auto convert the PHP variable types into XML-RPC types

  • return: Array of Zend_XmlRpc_Value objects
  • access: protected
array|null _convertParams (array &$params, [string $methodName = null])
  • array $params: Array of PHP varaibles and/or Zend_XmlRpc_Value objects The parameter is passed by reference
  • string $methodName: If set, the type hinting will be according to the parameters of this method
_getMethodParams (line 551)

Return the XML-RPC types of the necessary parameters for a method in the service Get the types from the _methodSignatures data member {@see __getMethodsXml() for more information}

  • return: XML-RPC types of the method parameters (or an empty array if there are no parameters)
  • access: protected
array _getMethodParams (string $methodName)
  • string $methodName
_getSignatures (line 448)

Call system.methodSignature() for all the given methods

  • return: Structure of array is method_name => method signature as returned from system.methodSignature() call
  • access: private
array _getSignatures (array $methodNames)
  • array $methodNames: Array of method names to get their signatures
_getSignaturesMultiCall (line 414)

Use system.methodSignature() to get all the given methods signatures using the system.multicall() method

Attempt to get the method signatures in one request via system.multicall(). This is a boxcar feature of XML-RPC and is found on fewer servers, however can significantly improve performance if present. For more information on system.multicall(), see: http://www.xmlrpc.com/discuss/msgReader$1208

  • return: Structure of array is method_name => method signature as returned from system.methodSignature() call
  • access: private
array _getSignaturesMultiCall (array $methodNames)
  • array $methodNames: Array of method names to get their signatures
_parseResponse (line 354)

Parse the response from a XML-RPC method call, hold the response as a Zend_XmlRpc_Value object The response parameter must be a valid XML string

  • access: protected
void _parseResponse (string $response)
  • string $response: XML string to parse
_sendRequest (line 301)

Send a XML-RPC request to the service (for a specific method)

  • access: protected
  • throws: Zend_Http_Client_Exception
void _sendRequest (string $method, [array $params = null])
  • string $method: Name of the method we want to call
  • array $params: Array of Zend_XmlRpc_Value objects, parameters for the method
__call (line 136)

Using the magic __call function to call methods directly by method name

  • access: public
void __call (string $methodName, array $params)
  • string $methodName: The method we call from the service
  • array $params: Array of parameters for the method call
__get (line 120)

Undefined properties are assumed to be XML-RPC namespaces and return a decorator to enable object chains.

  • access: public
Zend_XmlRpc_Client_NamespaceDecorator __get (string $namespace)
  • string $namespace
__getMethodsXml (line 170)

Generates an XML string containing the signatures for every method on the remote server by calling system.listMethods() and then calling system.methodSignature() for each method. This output generated is analogous to SOAP's WSDL file.

  • return: XML representing the signatures of all server methods, analogous to SOAP's WSDL file
  • access: public
string __getMethodsXml ()
__getResponse (line 272)

The response received from the method call, response can be retrieved in 3 formats:

  • as a PHP varaible,
  • as XML string,
  • or in the Zend_XmpRpc_Value object

  • return: The response of the service
  • access: public
mixed __getResponse ([Zend_XmlRpc_Client::RESPONSE_* $type = self::RESPONSE_PHP_NATIVE])
  • Zend_XmlRpc_Client::RESPONSE_* $type: The response value types, options are: PHP native type, original XML string or Zend_XmlRpc_Value object
__setMethodsXml (line 207)

Consumes an XML string generated by __getMethodsXml() and uses it for type hinting. When a remote method is called, either trapped by __call() or called with __xmlRpcCall(),

  • access: public
void __setMethodsXml ([null|string $methodsXml = null])
  • null|string $methodsXml: Use null for clearing the current method signatures
__xmlrpcCall (line 153)

Call a specific method (with or without parameters) from the XML-RPC service

  • access: public
void __xmlrpcCall (string $methodName, varargs 1)
  • string $methodName: The method we call from the service
  • varargs 1: Optional, Parameters to pass the method, multiple (using func_get_args() function) parameter of native PHP types or Zend_XmlRpc_Value objects
Class Constants
RESPONSE_PHP_NATIVE = 'php_native' (line 57)

Different types for the response: as PHP native types, original XML or in Zend_XmlRpc_Value object

RESPONSE_XML_STRING = 'xml_string' (line 58)
RESPONSE_ZXMLRPC_OBJECT = 'Zend_XmlRpc_Value_object' (line 59)

Documentation generated on Tue, 18 Apr 2006 11:54:40 -0700 by phpDocumentor 1.3.0RC3