Qore xml Module 2.0.0
|
The XmlRpcClient class provides easy access to XML-RPC web services. More...
#include <QC_XmlRpcClient.dox.h>
Public Member Methods | |
hash | call (string method,...) |
Calls a remote method taking all arguments after the method name for the method arguments and returns the response as qore data structure. | |
hash | callArgs (string method, any args) |
Calls a remote method using a single value after the method name for the method arguments and returns the response as a Qore data structure. | |
hash | callArgsWithInfo (reference info, string method, any args) |
Calls a remote method using a single value after the method name for the method arguments and returns the response as qore data structure, accepts a reference to a hash as the first argument to give technical information about the call. | |
hash | callWithInfo (reference info, string method,...) |
Calls a remote method taking all arguments after the method name for the method arguments and returns the response as qore data structure, accepts a reference to a hash as the first argument to give technical information about the call. | |
constructor () | |
Creates the XmlRpcClient object with no parameters. | |
constructor (hash opts, softbool no_connect=False) | |
Creates the XmlRpcClient object based on the parameters passed. | |
copy () | |
Throws an exception; copying XmlRpcClient objects is currently not supported. | |
nothing | setEventQueue () |
clears the event queue for the XmlRpcClient object | |
nothing | setEventQueue (Queue queue) |
sets the event queue for the XmlRpcClient object | |
The XmlRpcClient class provides easy access to XML-RPC web services.
This class inherits all public methods of the HTTPClient class. The inherited HTTPClient methods are not listed in this section, see the section on the HTTPClient class for more information on methods provided by the parent class. For a list of low-level XML-RPC functions, see XML-RPC.
The XmlRpcClient class understands the following protocols in addition to the protocols supported by the HTTPClient class:
XmlRpcClient Class Protocols
Protocol | Default Port | SSL? | Description |
xmlrpc | 80 | No | Unencrypted XML-RPC protocol over HTTP |
xmlrpcs | 443 | Yes | XML-RPC protocol over HTTP with SSL/TLS encryption |
The XmlRpcClient supplies default values for HTTP headers as follows:
XmlRpcClient Default, but Overridable Headers
Header | Default Value |
Accept | text/xml |
Content-Type | text/xml |
User-Agent | Qore-XML-RPC-Client/1.1 |
Connection | Keep-Alive |
default_path
is given in the constructor(), then "RPC2"
is usedPO_NO_NETWORK
parse option. hash Qore::Xml::XmlRpcClient::call | ( | string | method, |
... | |||
) |
Calls a remote method taking all arguments after the method name for the method arguments and returns the response as qore data structure.
method | The XML-RPC method name to call |
... | the arguments to the call |
params:
will be present if the call completed normallyfault:
will be present if the call is returning with error information; if this key is present then the value will be a hash with the following two keys:faultCode:
an integer fault codefaultString:
a string error messageXMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object) |
PARSE-XMLRPC-RESPONSE-ERROR | missing required element or other syntax error |
PARSE-XMLRPC-ERROR | syntax error parsing XML-RPC string |
HTTP-CLIENT-TIMEOUT | timeout on response from HTTP server |
HTTP-CLIENT-RECEIVE-ERROR | error communicating with HTTP server |
hash Qore::Xml::XmlRpcClient::callArgs | ( | string | method, |
any | args | ||
) |
Calls a remote method using a single value after the method name for the method arguments and returns the response as a Qore data structure.
method | The XML-RPC method name to call |
args | An optional list of arguments (or single argument) for the method |
params:
will be present if the call completed normallyfault:
will be present if the call is returning with error information; if this key is present then the value will be a hash with the following two keys:faultCode:
an integer fault codefaultString:
a string error messageXMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object) |
PARSE-XMLRPC-RESPONSE-ERROR | missing required element or other syntax error |
PARSE-XMLRPC-ERROR | syntax error parsing XML-RPC string |
HTTP-CLIENT-TIMEOUT | timeout on response from HTTP server |
HTTP-CLIENT-RECEIVE-ERROR | error communicating with HTTP server |
hash Qore::Xml::XmlRpcClient::callArgsWithInfo | ( | reference | info, |
string | method, | ||
any | args | ||
) |
Calls a remote method using a single value after the method name for the method arguments and returns the response as qore data structure, accepts a reference to a hash as the first argument to give technical information about the call.
info | a reference to a hash that provides the following keys on output giving technical information about the HTTP call:
|
method | The XML-RPC method name to call |
args | An optional list of arguments (or single argument) for the method |
params:
will be present if the call completed normallyfault:
will be present if the call is returning with error information; if this key is present then the value will be a hash with the following two keys:faultCode:
an integer fault codefaultString:
a string error messageXMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object) |
PARSE-XMLRPC-RESPONSE-ERROR | missing required element or other syntax error |
PARSE-XMLRPC-ERROR | syntax error parsing XML-RPC string |
HTTP-CLIENT-TIMEOUT | timeout on response from HTTP server |
HTTP-CLIENT-RECEIVE-ERROR | error communicating with HTTP server |
hash Qore::Xml::XmlRpcClient::callWithInfo | ( | reference | info, |
string | method, | ||
... | |||
) |
Calls a remote method taking all arguments after the method name for the method arguments and returns the response as qore data structure, accepts a reference to a hash as the first argument to give technical information about the call.
info | a reference to a hash that provides the following keys on output giving technical information about the HTTP call:
|
method | The XML-RPC method name to call |
... | the arguments to the call |
params:
will be present if the call completed normallyfault:
will be present if the call is returning with error information; if this key is present then the value will be a hash with the following two keys:faultCode:
an integer fault codefaultString:
a string error messageXMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object) |
PARSE-XMLRPC-RESPONSE-ERROR | missing required element or other syntax error |
PARSE-XMLRPC-ERROR | syntax error parsing XML-RPC string |
HTTP-CLIENT-TIMEOUT | timeout on response from HTTP server |
HTTP-CLIENT-RECEIVE-ERROR | error communicating with HTTP server |
Qore::Xml::XmlRpcClient::constructor | ( | ) |
Creates the XmlRpcClient object with no parameters.
No connection is made because no connection parameters are set with this call; connection parameters must be set afterwards using the appropriate HTTPClient methods.
Qore::Xml::XmlRpcClient::constructor | ( | hash | opts, |
softbool | no_connect = False |
||
) |
Creates the XmlRpcClient object based on the parameters passed.
By default the object will immediately attempt to establish a connection to the server
opts | HTTPClient constructor options:
|
no_connect | pass a boolean True value argument to suppress the automatic connection and establish a connection on demand with the first request |
Qore::Xml::XmlRpcClient::copy | ( | ) |
Throws an exception; copying XmlRpcClient objects is currently not supported.
XMLRPCCLIENT-COPY-ERROR | copying XmlRpcClient objects is currently not supported |
nothing Qore::Xml::XmlRpcClient::setEventQueue | ( | ) |
clears the event queue for the XmlRpcClient object
nothing Qore::Xml::XmlRpcClient::setEventQueue | ( | Queue | queue | ) |
sets the event queue for the XmlRpcClient object
queue | the Queue object to receive network events from the XmlRpcClient object |