web_services2Add my vote for this tag xml1Add my vote for this tag create new tag
, view all tags

XML-RPC Contrib

XML-RPC services for TWiki


This package allows to register handlers for remote procedures the same way tags are registered to the TWiki engine. The xmlrpc cgi will then call them on request.


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 TWiki 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.


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 TWiki session object
  • $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 TWiki 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.


  • Set SHORTDESCRIPTION = XML-RPC services for TWiki
  • Set STUB = %$STUB%

Installation Instructions

  • Download the ZIP file
  • Unzip it in your twiki installation directory. Content:
    File: Description:
    bin/xmlrpc server cgi
    data/TWiki/XmlRpcContrib.txt contrib topic
    lib/TWiki/Contrib/XmlRpcContrib.pm perl module
    lib/TWiki/Contrib/XmlRpcContrib/Server.pm server module
  • possibly enable/secure the xmlrpc in bin/.htaccess so that it gets recognized as a cgi script at least

Contrib Info

Author: TWiki:Main/MichaelDaum
Copyright: © 2006, MichaelDaum http://wikiring.com,
© 2006-2010 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Version: 19285 (2010-07-30)
Change History:  
2010-07-27: TWikibug:Item6530 - doc fixes
15 June 2006: first public release
28 May 2006: Initial version
CPAN Dependencies: CPAN:RPC::XML
Home: http://twiki.org/cgi-bin/view/Plugins/XmlRpcContrib
Feedback: http://twiki.org/cgi-bin/view/Plugins/XmlRpcContribDev
Appraisal: http://twiki.org/cgi-bin/view/Plugins/XmlRpcContribAppraisal
Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 XmlRpcContrib.md5 r5 r4 r3 r2 r1 manage 0.2 K 2010-07-31 - 06:13 PeterThoeny  
Compressed Zip archivetgz XmlRpcContrib.tgz r5 r4 r3 r2 r1 manage 5.4 K 2010-07-31 - 06:13 PeterThoeny  
Compressed Zip archivezip XmlRpcContrib.zip r5 r4 r3 r2 r1 manage 8.4 K 2010-07-31 - 06:13 PeterThoeny  
Unknown file formatEXT XmlRpcContrib_installer r3 r2 r1 manage 3.5 K 2010-07-31 - 06:13 PeterThoeny  
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r13 - 2013-10-16 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.