In my Server execute method, I am calling another function locally defined. I get a "XmlRpcServerConnection::executeRequest: fault type error." just at the function call. Please help in finding out the problem.
Below is the code and the error message.
class saveParameters : public XmlRpcServerMethod
{
public:
saveParameters(XmlRpcServer* s) : XmlRpcServerMethod("saveParameters", s) {}
std::cout << "About to validate" << std::endl;
tempString = validateKeepAliveRetries(temp[token]);
result = errString;
std::cout << "Result = " << result << std::endl;
}
char* validateKeepAliveRetries(XmlRpcValue v)
{
int value = (int)v;
std::cout << "In Validate" << "value = " << v << std::endl;
char* result = "";
if ((value < 1) || (value > 10))
{
result = "OutOfRange, 1, 10";
}
std::cout << "Result in Validate = " << result << std::endl;
return result;
}
}
ERROR/OUTPUT:
XmlRpcServer::bindAndListen: server listening on port 8000 fd 924
XmlRpcServer::work: waiting for a connection
XmlRpcServer::acceptConnection: socket 916
XmlRpcServer::acceptConnection: creating a connection
XmlRpcServerConnection: new socket 916.
XmlRpcSocket::nbRead: read/recv returned 624.
XmlRpcSocket::nbRead: read/recv returned -1.
XmlRpcServerConnection::readHeader: read 624 bytes.
XmlRpcServerConnection::readHeader: specified content length is 385.
KeepAlive: 1
XmlRpcServerConnection::readRequest read 385 bytes.
XmlRpcServerConnection::executeRequest: server calling method 'saveParameters'
About to validate
XmlRpcServerConnection::executeRequest: fault type error.
XmlRpcSocket::nbWrite: send/write returned 327.
XmlRpcServerConnection::writeResponse: wrote 327 of 327 bytes.
XmlRpcSocket::nbRead: read/recv returned -1.
XmlRpcSource::close: closing socket 916.
XmlRpcSocket::close: fd 916.
XmlRpcSource::close: done closing socket 916.
XmlRpcSource::close: deleting this
XmlRpcServerConnection dtor.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
In my Server execute method, I am calling another function locally defined. I get a "XmlRpcServerConnection::executeRequest: fault type error." just at the function call. Please help in finding out the problem.
Below is the code and the error message.
class saveParameters : public XmlRpcServerMethod
{
public:
saveParameters(XmlRpcServer* s) : XmlRpcServerMethod("saveParameters", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
XmlRpcValue temp = params[0];
char *tempString = "";
std::cout << "About to validate" << std::endl;
tempString = validateKeepAliveRetries(temp[token]);
result = errString;
std::cout << "Result = " << result << std::endl;
}
char* validateKeepAliveRetries(XmlRpcValue v)
{
int value = (int)v;
std::cout << "In Validate" << "value = " << v << std::endl;
char* result = "";
if ((value < 1) || (value > 10))
{
result = "OutOfRange, 1, 10";
}
std::cout << "Result in Validate = " << result << std::endl;
return result;
}
}
ERROR/OUTPUT:
XmlRpcServer::bindAndListen: server listening on port 8000 fd 924
XmlRpcServer::work: waiting for a connection
XmlRpcServer::acceptConnection: socket 916
XmlRpcServer::acceptConnection: creating a connection
XmlRpcServerConnection: new socket 916.
XmlRpcSocket::nbRead: read/recv returned 624.
XmlRpcSocket::nbRead: read/recv returned -1.
XmlRpcServerConnection::readHeader: read 624 bytes.
XmlRpcServerConnection::readHeader: specified content length is 385.
KeepAlive: 1
XmlRpcServerConnection::readRequest read 385 bytes.
XmlRpcServerConnection::executeRequest: server calling method 'saveParameters'
About to validate
XmlRpcServerConnection::executeRequest: fault type error.
XmlRpcSocket::nbWrite: send/write returned 327.
XmlRpcServerConnection::writeResponse: wrote 327 of 327 bytes.
XmlRpcSocket::nbRead: read/recv returned -1.
XmlRpcSource::close: closing socket 916.
XmlRpcSocket::close: fd 916.
XmlRpcSource::close: done closing socket 916.
XmlRpcSource::close: deleting this
XmlRpcServerConnection dtor.