sipxtacklib  Version 3.3
Public Member Functions | Friends | List of all members
XmlRpcRequest Class Reference

This object is used to create a XML-RPC request to a specific remote XML-RPC server. More...

#include <XmlRpcRequest.h>

Public Member Functions

 XmlRpcRequest (Url &uri, const char *methodName)
 Contruct an XML-RPC request for a given method. More...
 
virtual ~XmlRpcRequest ()
 Destructor. More...
 
bool execute (XmlRpcResponse &response, int timeoutMilliSeconds=XML_RPC_TIMEOUT, UtlBoolean usePersistentConnections=TRUE)
 Execute the named procedure on the remote server. More...
 
bool addParam (UtlContainable *value)
 Add an atomic param to the XML-RPC request. More...
 

Friends

class XmlRpcTest
 
class ResultSetRpcTest
 

Detailed Description

This object is used to create a XML-RPC request to a specific remote XML-RPC server.

The caller is required to create this object for each XML-RPC request.

The caller uses the addParam(), addArray() and/or addStruct() functions to build up XML-RPC request content in XmlRpcBody.

All the param types must be UtlContainable. Here is the mapping from XML-RPC types to UtlContainable types:

<i8> is a SIPfoundry extension to XML-RPC that is not compatible with other XML-RPC implementations. <double> and <base64> are currently not supported.

The execute() function closes the XML-RPC request frame and sends the request to the remote server specified in the Url. The execute() function receives the XmlRpcResponse from the remote server. If the return is true, the caller can use getResponse() to obtain the response value. If the return is false, the caller can use getFault() in XmlRpcResponse to get the fault code and fault string.

Constructor & Destructor Documentation

XmlRpcRequest ( Url uri,
const char *  methodName 
)

Contruct an XML-RPC request for a given method.

Parameters
uriuri type can only be either http or https
methodNamename of the method in XML-RPC request
~XmlRpcRequest ( )
virtual

Destructor.

Member Function Documentation

bool execute ( XmlRpcResponse response,
int  timeoutMilliSeconds = XML_RPC_TIMEOUT,
UtlBoolean  usePersistentConnections = TRUE 
)

Execute the named procedure on the remote server.

Note
This is a synchronous (blocking) implementation (execute does not return until it receives a response, timeout or an error).

If the return is false, the caller can use response.getFault() to obtain the fault code and fault string.

Parameters
responseresponse returned from the remote server
bool addParam ( UtlContainable *  value)

Add an atomic param to the XML-RPC request.

value for the param

Friends And Related Function Documentation

friend class XmlRpcTest
friend
friend class ResultSetRpcTest
friend

sipXtackLib home page