TIP XmlRpcContrib is not installed on Foswiki.org.


xml-rpc interface for foswiki

This package allows to register handlers for remote procedures the same way tags are registered to the Foswiki engine. XML-RPC requests will be handled using a dedicated xmlrpc entry point, similar to standard rest invocations.

XmlRpcContrib API

registerRPCHandler($name, $impl)

register an implementation for a handler

  • $name: symbolic method name
  • $impl: implementation of a handler for the given method name

dispatch($session, $data)

process a remote procedure call

  • $session: the current Foswiki session objecet
  • $data: the net data to be processed (optional)

If no data is passed it is requested from the CGI query object. During execution the context xmlrpc is entered as well as the context of the symbolic method name.

This call will be delegate to XmlRpcContrib::Server::dispatch and print out its result to STDOUT.

XmlRpcContrib::Server API

light implementation of an XML-RPC server


create a new server object

  • %handler: hash mapping method names to their implementation

The server is a singleton object in the XmlRpcContrib namespace.

dispatch($session, $data)

carry out the procedure call

  • $session: the current Foswiki session objecet
  • $data: xml request data

This will call the method implementation if available or return an error if not available. A method must implement the interface

($status, $error, $result) = handleRPCCall($session, $requestargs)

  • $session: is the current Foswiki session object
  • $requestargs: is an array of methods parameters

The handler must return an array ($status, $error, $result) where
  • $status: string representation of the status
  • $error: error code
  • $result: the procedure's result data

If $error is null, a response is created using $result if it is an RPC::XML object already, or create an RPC::XML::string from it. If $error is a non-null value a server error occured and an RPC::XML::fault object is respondend (see getError()).

getResponse($status, $data)

create a well-formated RPC::XML::response that can be printed to STDOUT on completion

  • $status: response status value
  • $data: net data

returns the formatted response

getError($status, $error, $data)

creates a RPC::XML::fault object using the $error and its $data and returns the formatted error response.

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.


Author: Michael Daum
Copyright ©: 2006-2014, Michael Daum http://michaeldaumconsulting.com
License: GPL (GNU General Public License)
CPAN Dependencies: CPAN:RPC::XML
Version: 1.00
Release: 1.00
Change History:  
21 Apr 2010: ported to foswiki
15 June 2006: first public release
28 May 2006: Initial version
Home: Foswiki:Extensions/XmlRpcContrib
Support: Foswiki:Support/XmlRpcContrib
Topic revision: r4 - 29 Aug 2014, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy