[ class tree: XML_RPC2 ] [ index: XML_RPC2 ] [ all elements ]

Class: XML_RPC2_Backend_Php_Response

Source Location: /XML_RPC2-1.1.2/XML/RPC2/Backend/Php/Response.php

Class Overview

XML-RPC response backend class.



  • 2004-2006 Sergio Carvalho


Inherited Variables

Inherited Methods

Class Details

[line 61]
XML-RPC response backend class.

This class represents an XML_RPC request, exposing the methods needed to encode/decode an xml-rpc response.

[ Top ]

Method Detail

decode   [line 125]

mixed decode( SimpleXMLElement $xml)

Parse a response and either return the native PHP result.

This method receives an XML-RPC response document, in SimpleXML format, decodes it and returns the payload value.

  • Return: The response payload
  • See: http://www.xmlrpc.com/spec
  • Throws: XML_RPC2_FaultException Signals the decoded response was an XML-RPC fault
  • Throws: XML_RPC2_DecodeException Signals an ill formed payload response section
  • Access: public


SimpleXmlElement   $xml   —  The Transport XML

[ Top ]

encode   [line 80]

string encode( mixed $param, [string $encoding = 'utf-8'])

Encode a normal XML-RPC response, containing the provided value

You may supply a php-native value, or an XML_RPC2_Backend_Php_Value instance, to be returned. Usually providing a native value is more convenient. However, for some types, XML_RPC2_Backend_Php_Value::createFromNative can't properly choose the xml-rpc type. In these cases, constructing an XML_RPC2_Backend_Php_Value and using it as param here is the only way to return the desired type.


mixed   $param   —  The result value which the response will envelop
string   $encoding   —  encoding

[ Top ]

encodeFault   [line 102]

string encodeFault( int $code, string $message, [string $encoding = 'utf-8'])

Encode a fault XML-RPC response, containing the provided code and message


int   $code   —  Response code
string   $message   —  Response message
string   $encoding   —  encoding

[ Top ]

Documentation generated on Mon, 11 Mar 2019 15:56:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.