Ejemplo n.º 1
0
  void execute(XmlRpcValue& params, XmlRpcValue& result)
  {
    if (params[0].getType() != XmlRpcValue::TypeString)
      throw XmlRpcException(METHOD_HELP + ": Invalid argument type");

    XmlRpcServerMethod* m = _server->findMethod(params[0]);
    if ( ! m)
      throw XmlRpcException(METHOD_HELP + ": Unknown method name");

    result = m->help();
  }
Ejemplo n.º 2
0
// Execute a named method with the specified params.
bool XmlRpcServerConnection::executeMethod(const std::string& methodName, XmlRpcValue& params, XmlRpcValue& result)
{
	XmlRpcServerMethod* method = _server->findMethod(methodName);

	if ( ! method) return false;

	method->setAuthorization(_authorization);

	method->execute(&_saddr, params, result);

	// Ensure a valid result value
	if ( ! result.valid ())
		result = std::string ();

	return true;
}
Ejemplo n.º 3
0
// Execute a named method with the specified params.
bool
XmlRpcServer::executeMethod(const std::string& methodName, 
                            XmlRpcValue& params, 
                            XmlRpcValue& result)
{
  XmlRpcServerMethod* method = findMethod(methodName);

  if ( ! method) return false;

  method->execute(params, result);

  // Ensure a valid result value
  if ( ! result.valid())
      result = std::string();

  return true;
}