Hi,
I have been using this library for the last couple of weeks and I like it very much. It is very clean and lightweight. My thanks to the author.
I was wondering if anyone has a sample code for recieving an array of ints if I am running the server.
thanks a lot.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have been using this library for the last couple of weeks and I like it very much. It is very clean and lightweight. My thanks to the author.
I was wondering if anyone has a sample code for recieving an array of ints if I am running the server.
thanks a lot.
There are some examples of similar methods in the Validator example program, but you want to do something like this:
// A server method that accepts one argument,
// which is an array of ints.
// It returns the sum of the ints.
class SumOfInts : public XmlRpcServerMethod
{
public:
SumOfInts(XmlRpcServer* s) : XmlRpcServerMethod("SumOfInts", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
int n = params[0].size(), sum = 0;
for (int i=0; i<n; ++i)
sum += int(params[0][i]);
result = sum;
}
};
Chris