/usr/include/sipxtapi/net/XmlRpcRequest.h is in libsipxtapi-dev 3.3.0~test17-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | //
// Copyright (C) 2006-2011 SIPez LLC. All rights reserved.
//
// Copyright (C) 2004-2006 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
///////////////////////////////////////////////////////////////////////////////
#ifndef _XMLRPCREQUEST_H_
#define _XMLRPCREQUEST_H_
// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include <utl/UtlString.h>
#include <utl/UtlSList.h>
#include <utl/UtlHashMap.h>
#include "net/Url.h"
#include "net/HttpMessage.h"
#include "net/XmlRpcBody.h"
#include "net/XmlRpcResponse.h"
// DEFINES
// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
const int XML_RPC_TIMEOUT = 5*1000;
// STRUCTS
// TYPEDEFS
// FORWARD DECLARATIONS
class ResultSetRpcTest; // unit test - see sipXcommserverLib/src/test/ResultSetRpcTest.cpp
/**
* 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.
*
* - addParam() is for adding a param in the XmlRpcRequest.
*
* All the param types must be UtlContainable. Here is the mapping from XML-RPC
* types to UtlContainable types:
*
* * \<i4\> or \<int\> is UtlInt.
* * \<i8\> is UtlLongLongInt
* * \<boolean\> is UtlBool.
* * \<string\> is UtlString.
* * \<dateTime.iso8601\> is UtlDateTime.
* * \<array\> is UtlSList.
* * \<struct\> is UtlHashMap.
*
* \<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.
*
*/
class XmlRpcRequest
{
/* //////////////////////////// PUBLIC //////////////////////////////////// */
public:
friend class XmlRpcTest;
/* ============================ CREATORS ================================== */
/// Contruct an XML-RPC request for a given method
XmlRpcRequest(Url& uri, ///< uri type can only be either http or https
const char* methodName ///< name of the method in XML-RPC request
);
/// Destructor
virtual ~XmlRpcRequest();
/// Execute the named procedure on the remote server.
bool execute(XmlRpcResponse& response, ///< response returned from the remote server
int timeoutMilliSeconds = XML_RPC_TIMEOUT,
UtlBoolean usePersistentConnections = TRUE);
/**<
* @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.
*
*/
/* ============================ MANIPULATORS ============================== */
/// Add an atomic param to the XML-RPC request
bool addParam(UtlContainable* value); ///< value for the param
/* ============================ ACCESSORS ================================= */
/* ============================ INQUIRY =================================== */
/* //////////////////////////// PROTECTED ///////////////////////////////// */
protected:
friend class ResultSetRpcTest;
/* //////////////////////////// PRIVATE /////////////////////////////////// */
private:
/// Url for the XML-RPC request
Url mUrl;
/**<
* Only http or https can be used.
*/
/// client for sending out XML-RPC request
HttpMessage* mpHttpRequest;
/// XML-RPC body
XmlRpcBody* mpRequestBody;
/// Disabled copy constructor
XmlRpcRequest(const XmlRpcRequest& rXmlRpcRequest);
/// Disabled assignment operator
XmlRpcRequest& operator=(const XmlRpcRequest& rhs);
};
/* ============================ INLINE METHODS ============================ */
#endif // _XMLRPCREQUEST_H_
|