We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Plugins Web>XmlRpcContrib (13 Oct 2006, MichaelDaum)
Tags:
web_services1Add my vote for this tag xml1Add my vote for this tag create new tag
, view all tags

XmlRpcContrib

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.

XmlRpcContrib

registerRPCHandler($name, $impl)

register an implementation for a handler

Parameters:

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

dispatch($session, $data)

process a remote procedure call

Parameters:

  • $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.

XmlRpcContrib::Server

light implementation of an XML-RPC server

new(%handler)

create a new server object

Parameters:

  • %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

Parameters:

  • $session: the current TWiki 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)

where:

  • $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

Parameters:

  • $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.

Settings

  • Set SHORTDESCRIPTION = XML-RPC services for TWiki
  • Set STUB = TWiki::Contrib::XmlRpcContrib

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
License: GPL (GNU General Public License)
CPAN Dependencies: CPAN:RPC::XML
Version: v0.03
Change History:  
15 June 2006: first public release
28 May 2006: Initial version
Home: TWiki:Plugins/XmlRpcContrib
Feedback: TWiki:Plugins/XmlRpcContribDev
Appraisal: TWiki:Plugins/XmlRpcContribAppraisal

-- TWiki:Main/MichaelDaum - 15 June 2006

Topic attachments
I Attachment Action Size Date Who Comment
elsemd5 XmlRpcContrib.md5 manage 0.2 K 13 Oct 2006 - 18:15 MichaelDaum  
ziptgz XmlRpcContrib.tgz manage 28.4 K 13 Oct 2006 - 18:15 MichaelDaum  
zipzip XmlRpcContrib.zip manage 15.4 K 13 Oct 2006 - 18:15 MichaelDaum  
elseEXT XmlRpcContrib_installer manage 28.0 K 13 Oct 2006 - 18:15 MichaelDaum  
Topic revision: r7 - 13 Oct 2006 - 18:15:39 - MichaelDaum
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback