Go to the documentation of this file.
16 int main(
int argc,
char* argv[])
19 std::cerr <<
"Usage: FileClient serverHost serverPort requestXmlFile\n";
22 int port = atoi(argv[2]);
28 std::ifstream infile(argv[3]);
30 std::cerr <<
"Could not open file '" << argv[3] <<
"'.\n";
35 infile.seekg(0L, std::ios::end);
36 long nb = infile.tellg();
39 char* b =
new char[nb+1];
43 std::cout <<
"Read file.\n";
51 std::cerr <<
"Could not parse file\n";
57 std::cout <<
"Calling " << name << std::endl;
58 if (c.
execute(name.c_str(), params, result))
59 std::cout << result <<
"\n\n";
61 std::cout <<
"Error calling '" << name <<
"'\n\n";
62 std::cout <<
"Again? [y]: ";
65 if (ans !=
"" && ans !=
"y")
break;
76 const char METHODNAME_TAG[] =
"<methodName>";
77 const char PARAMS_TAG[] =
"<params>";
78 const char PARAMS_ETAG[] =
"</params>";
79 const char PARAM_TAG[] =
"<param>";
80 const char PARAM_ETAG[] =
"</param>";
85 XmlRpcUtil::log(3,
"XmlRpcServerConnection::parseRequest: parsed methodName %s.", methodName.c_str());
91 std::cout <<
"Parsing arg " << nArgs+1 << std::endl;
94 std::cerr <<
"Invalid argument\n";
97 std::cout <<
"Adding arg " << nArgs+1 <<
" to params array." << std::endl;
98 params[nArgs++] = arg;
102 XmlRpcUtil::log(3,
"XmlRpcServerConnection::parseRequest: parsed %d params.", nArgs);
XMLRPCPP_DECL void setVerbosity(int level)
Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level)
static void log(int level, const char *fmt,...)
Dump messages somewhere.
bool execute(const char *method, XmlRpcValue const ¶ms, XmlRpcValue &result)
A class to send XML RPC requests to a server and return the results.
std::string parseRequest(std::string const &xml, XmlRpcValue ¶ms)
static std::string parseTag(const char *tag, std::string const &xml, int *offset)
static bool findTag(const char *tag, std::string const &xml, int *offset)
Returns true if the tag is found and updates offset to the char after the tag.
int main(int argc, char *argv[])
static bool nextTagIs(const char *tag, std::string const &xml, int *offset)
bool valid() const
Return true if the value has been set to something.
RPC method arguments and results are represented by Values.
xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:32