Qore XmlRpcHandler Module Reference  1.1
 All Classes Namespaces Functions Variables Pages

Introduction to the XmlRpcHandler Module

This module implements server-side support for the XML-RPC protocol for serialization/deserialization of message data.

This module provides the XmlRpcHandler class which can be used to provide an RPC handler for the HttpServer class provided by the HttpServer module.

Example Usage

%requires HttpServer
%requires XmlRpcHandler
%requires Mime
const ApiMethods = (
("name": "^sys\\.shutdown\$",
"text": "sys.shutdown",
"function": sub () { background $http.stop(); return "OK"; },
"help": "shuts down this server",
"logopt": 0,
),
);
# a logging closure
my code $log = sub (string $str) {printf("%y: %s\n", now_us(), $str);};
# our bind address
const Bind = 8888;
my XmlRpcHandler $xmlRpcHandler(new AbstractAuthenticator(), $api);
our HttpServer $http($log, $log);
$http.addListener(Bind);
$http.setHandler("xmlrpc", "", MimeTypeXmlRpc, $xmlRpcHandler);
$http.setDefaultHandler("xmlrpc", $xmlRpcHandler);
$log("now listening on %s\n", Bind);
$http.waitStop();