Fully Qualified Name: | 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()}.
Name | Description | Defined By |
---|---|---|
__construct() | Create a new XML-RPC request | Request |
__toString() | Return XML request | Request |
addParam() | Add a parameter to the parameter stack | Request |
getEncoding() | Retrieve current request encoding | Request |
getFault() | Retrieve the fault response, if any | Request |
getMethod() | Retrieve call method | Request |
getParams() | Retrieve the array of parameters | Request |
getTypes() | Return parameter types | Request |
isFault() | Does the current request contain errors and should it return a fault response? | Request |
loadXml() | Load XML and parse into request components | Request |
saveXml() | Create XML request | Request |
setEncoding() | Set encoding to use in request | Request |
setMethod() | Set method to call | Request |
setParams() | Set the parameters array | Request |
Create a new XML-RPC request
Parameter Name | Type | Description |
---|---|---|
$method | string | (optional) |
$params | array | (optional) |
Returns:
Return XML request
Returns: string
Add a parameter to the parameter stack
Adds a parameter to the parameter stack, associating it with the type $type if provided
Parameter Name | Type | Description |
---|---|---|
$value | mixed | |
$type | string | Optional; |
Returns: void
Retrieve current request encoding
Returns: string
Retrieve the fault response, if any
Returns: null|\Zend\XmlRpc\Fault
Retrieve call method
Returns: string
Retrieve the array of parameters
Returns: array
Return parameter types
Returns: array
Does the current request contain errors and should it return a fault response?
Returns: bool
Load XML and parse into request components
Parameter Name | Type | Description |
---|---|---|
$request | string |
Returns: bool True on success, false if an error occurred.
Create XML request
Returns: string
Set encoding to use in request
Parameter Name | Type | Description |
---|---|---|
$encoding | string |
Returns: \Zend\XmlRpc\Request
Set method to call
Parameter Name | Type | Description |
---|---|---|
$method | string |
Returns: bool Returns true on success, false if method name is invalid
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:
$array = array(
array(
'value' => $value,
'type' => $type
)[, ... ]
);
Returns: void