2098. Class

2098.1. Zend\XmlRpc\Request

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 {@link $fault}; developers may check for it using {@link isFault()} and {@link getFault()}.

2098.1.1. Methods

2098.1.1.1. __construct

__construct()

Create a new XML-RPC request

Parameters:
  • string – (optional)
  • array – (optional)

2098.1.1.2. setEncoding

setEncoding()

Set encoding to use in request

Parameters:string
Return type:ZendXmlRpcRequest

2098.1.1.3. getEncoding

getEncoding()

Retrieve current request encoding

Return type:string

2098.1.1.4. setMethod

setMethod()

Set method to call

Parameters:string
Return type:bool Returns true on success, false if method name is invalid

2098.1.1.5. getMethod

getMethod()

Retrieve call method

Return type:string

2098.1.1.6. addParam

addParam()

Add a parameter to the parameter stack

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

Parameters:
  • mixed
  • string – Optional; type hinting
Return type:

void

2098.1.1.7. setParams

setParams()

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: <code> $array = array(

array(
‘value’ => $value, ‘type’ => $type

)[, ... ]

); </code>

Return type:void

2098.1.1.8. getParams

getParams()

Retrieve the array of parameters

Return type:array

2098.1.1.9. getTypes

getTypes()

Return parameter types

Return type:array

2098.1.1.10. loadXml

loadXml()

Load XML and parse into request components

Parameters:string
Throws ExceptionValueException:
 if invalid XML
Return type:bool True on success, false if an error occurred.

2098.1.1.11. isFault

isFault()

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

Return type:bool

2098.1.1.12. getFault

getFault()

Retrieve the fault response, if any

Return type:null|ZendXmlRpcFault

2098.1.1.13. _getXmlRpcParams

_getXmlRpcParams()

Retrieve method parameters as XMLRPC values

Return type:array

2098.1.1.14. saveXml

saveXml()

Create XML request

Return type:string

2098.1.1.15. __toString

__toString()

Return XML request

Return type:string