sipxtacklib
Version 3.3
|
A XmlRpcDispatch is a object that monitors the incoming XML-RPC requests, parses XmlRpcRequest messages, invokes the correct XmlRpcMethod calls, and sends back the corresponding XmlRpcResponse responses. More...
#include <XmlRpcDispatch.h>
Public Member Functions | |
XmlRpcDispatch (int httpServerPort, bool isSecureServer, const char *uriPath=DEFAULT_URL_PATH, const char *httpBindAddress=NULL) | |
Create a dispatch object. More... | |
virtual | ~XmlRpcDispatch () |
Destructor. More... | |
void | processRequest (const HttpRequestContext &requestContext, const HttpMessage &request, HttpMessage *&response) |
Handler for XML-RPC requests. More... | |
void | addMethod (const char *methodName, XmlRpcMethod::Get *method, void *userData=NULL) |
Add a method to the RPC dispatch. More... | |
void | removeMethod (const char *methodName) |
Remove a method from the RPC dispatch by name. More... | |
HttpServer * | getHttpServer () |
Return the HTTP server that services RPC requests. More... | |
Public Member Functions inherited from HttpService | |
HttpService () | |
Constructor. More... | |
virtual | ~HttpService () |
Destructor. More... | |
Static Public Member Functions | |
static bool | parseValue (TiXmlNode *valueNode, int index, UtlSList ¶ms) |
Parse a value in the XML-RPC request. More... | |
static void | cleanUp (UtlHashMap *members) |
Clean up the memory in a struct. More... | |
static void | cleanUp (UtlSList *array) |
Clean up the memory in an array. More... | |
Static Public Attributes | |
static const char * | DEFAULT_URL_PATH = "/RPC2" |
Protected Member Functions | |
bool | parseXmlRpcRequest (UtlString &requestContent, XmlRpcMethodContainer *&method, UtlSList ¶ms, XmlRpcResponse &response) |
Parse the XML-RPC request. More... | |
Friends | |
class | XmlRpcTest |
A XmlRpcDispatch is a object that monitors the incoming XML-RPC requests, parses XmlRpcRequest messages, invokes the correct XmlRpcMethod calls, and sends back the corresponding XmlRpcResponse responses.
If the correspnding method does not exit, it will send back a 404 response. Otherwise, it will always send back a 200 OK response with XmlRpcResponse content.
For each XML-RPC server, it needs to instantiate a XmlRpcDispatch object first, and then register each service method using addMethod() or remove the method using removeMethod().
XmlRpcDispatch | ( | int | httpServerPort, |
bool | isSecureServer, | ||
const char * | uriPath = DEFAULT_URL_PATH , |
||
const char * | httpBindAddress = NULL |
||
) |
Create a dispatch object.
httpServerPort | port number for HttpServer |
isSecureServer | option for HTTP or HTTPS |
uriPath | uri path |
httpBindAddress | IP address/interface to bind http server to |
|
virtual |
Destructor.
|
virtual |
Handler for XML-RPC requests.
Implements HttpService.
|
static |
Parse a value in the XML-RPC request.
|
static |
Clean up the memory in a struct.
|
static |
Clean up the memory in an array.
void addMethod | ( | const char * | methodName, |
XmlRpcMethod::Get * | method, | ||
void * | userData = NULL |
||
) |
Add a method to the RPC dispatch.
void removeMethod | ( | const char * | methodName | ) |
Remove a method from the RPC dispatch by name.
HttpServer * getHttpServer | ( | ) |
Return the HTTP server that services RPC requests.
|
protected |
Parse the XML-RPC request.
|
friend |
|
static |