Qore xml Module 2.1.0
Loading...
Searching...
No Matches
XmlRpcHandler::XmlRpcHandler Class Reference

XML-RPC Handler implementation; to be registered as a request handler in the HttpServer class. More...

#include <XmlRpcHandler.qm.dox.h>

Inherits AbstractHttpRequestHandler.

Public Member Methods

void constructor (soft< code > n_getLogMessage, bool dbg, soft< code > log, HttpServer::AbstractAuthenticator auth, list methods, soft< string > n_get_prefix)
 creates the handler with the given method list
 
void addMethod (auto cmark, int logopt, string help, string text, string name, code func)
 adds a method to the handler dynamically
 
void setDebug (bool dbg)
 turns on or off debugging; when debugging is enabled more verbose error messages are reported
 
bool getDebug ()
 returns the current status of the debug flag
 

Public Attributes

const auto Version = ...
 version of the implementation
 
const auto InternalMethods = ...
 internal methods (for introspection)
 
const auto XMLRPC_INVALID_XML = ...
 error code for invalid XML-RPC
 

Detailed Description

XML-RPC Handler implementation; to be registered as a request handler in the HttpServer class.

Member Function Documentation

◆ addMethod()

void XmlRpcHandler::XmlRpcHandler::addMethod ( auto  cmark,
int  logopt,
string  help,
string  text,
string  name,
code  func 
)

adds a method to the handler dynamically

Parameters
namea regular expression to use for matching the method name
funca string (giving a function name to call), a call reference, or a closure to call with the deserialized arguments to the method; the return value will be serialized to XML-RPC and sent back to the caller
textthe human-readable name of the method
helphelp text for the method
logoptlog options which can be used by a custom logger (see the getLogMessage parameter)
cmarkany value that will be added in the method hash under the "cmark" key

◆ constructor()

void XmlRpcHandler::XmlRpcHandler::constructor ( soft< code >  n_getLogMessage,
bool  dbg,
soft< code >  log,
HttpServer::AbstractAuthenticator  auth,
list  methods,
soft< string >  n_get_prefix 
)

creates the handler with the given method list

Parameters
authan authentication object (use new AbstractAuthenticator() for no authentication)
methodsa list of hashes with the following keys:
  • name: a regular expression to use for matching the method name
  • function: a string (giving a function name to call), a call reference, or a closure to call with the deserialized arguments to the method; the return value will be serialized to XML-RPC and sent back to the caller
  • text: the human-readable name of the method
  • help: help text for the method
  • logopt: (optional - by convention) log options which can be used by a custom logger (see the getLogMessage parameter)
n_getLogMessagean optional closure or call reference to be called when an incoming request is received; if this is set then it will be called with the following arguments: a context hash (see HttpServer::AbstractHttpRequestHandler::handleRequest() for a description of the context h ash), the method definition as passed in the methods argument to this constructor, and a reference to the arguments in this call
dbgthis parameter is set to True, then additional information will be logged when errors occur
n_get_prefixprefix to add to derived methods with GET requests if no "." characters are in the path
logan optional closure or call reference to be called when logging
Exceptions
XML-RPC-CONSTRUCTOR-ERRORmissing "name", "function", or "text" key in method hash, \c "function" key not assigned to a callable value

The documentation for this class was generated from the following file: