Tags:
create new tag
view all tags
We could offer access to the TWiki data via XML-RPC protocol. It can be used to link TWiki with another app, say, to update TWiki pages remotely.

Here is what http://www.xmlrpc.com/spec is saying:

This page provides all the information that an implementor needs.

Overview

XML-RPC is a Remote Procedure Calling protocol that works over the Internet.

An XML-RPC message is an HTTP-POST request. The body of the request is in XML. A procedure executes on the server and the value it returns is also formatted in XML.

Procedure parameters can be scalars, numbers, strings, dates, etc.; and can also be complex record and list structures.

Request example

Here's an example of an XML-RPC request:

  POST /RPC2 HTTP/1.0
  User-Agent: Frontier/5.1.2 (WinNT)
  Host: betty.userland.com
  Content-Type: text/xml
  Content-length: 181



  <?xml version="1.0"?>
  <methodCall>
    <methodName>examples.getStateName</methodName>
    <params>
      <param>
        <value><i4>41</i4></value>
      </param>
    </params>
  </methodCall>

Payload format

The payload is in XML, a single structure.

The must contain a sub-item, a string, containing the name of the method to be called. The string may only contain identifier characters, upper and lower-case A-Z, the numeric characters, 0-9, underscore, dot, colon and slash. It's entirely up to the server to decide how to interpret the characters in a methodName.

....snip...

here's a simple test client using CPAN:XMLRPC::Lite

#! /usr/bin/perl -w
use strict;
use Data::Dumper;
use XMLRPC::Lite;

my $proxy = XMLRPC::Lite->proxy( 'http://website.com/xmlrpc.cgi' ) or die $!;

my $data = $proxy->call( 'examples.getStateName', 41 )->result or die $!;
print Dumper( $data ), "\n";
-- WillNorris - 17 Jan 2004

Just putting it here as a brainstorming idea.

-- PeterThoeny - 22 Mar 2001

FWIW, SOAP (Simple Object Access Protocol) is the successor to XMLRPC, and from all I hear plus the brief time i've actually used it, SOAP is a better protocol for RPC. (Neither of these or the other competiting RPC initiatives are standards yet. Somewhere on http://www.w3.org there's a large chart of RPC protocols.) There is a SOAP library for Perl.

-- DavidLeBlanc - 23 Mar 2001

I see no one's been around this topic in awhile, but I started playing around with a WikiRpcInterface for TWiki and UseModWiki. Poking around a bit more, but thought I might drop a line here.

-- LesOrchard - 14 Feb 2002

It's worth comparing this RPC approach to RSS (see WikiRssExtension), which is more of a SemanticWeb technique:

  • RPCs are good to extract very specific information required for a particular application, or to perform a transaction (e.g. adding a comment to a TWiki page, or a WYSIWYG TWiki page editor perhaps). Special front-end apps must be written to call the procedures as required, of course.
  • RSS is good for extracting key details of the Wiki site in last-changed order, and there are many tools and websites available to process RSS data. Most of the effort is on generating data in RDF format, which is relatively easy, and data-oriented interfaces may be more robust in the face of change than procedural APIs (what happens when you add a parameter to an XML-RPC interface?).

The two techniques are probably complementary, but I'd suggest looking at RSS first, perhaps defining an extension module a la WikiRssExtension, and then using RPCs if there's something that can't be done using RSS.

-- RichardDonkin - 19 Feb 2002

As per the discussion shaping up over on JSPWiki, I've implemented an initial version of a WikiRpcInterface for TWiki.

You can find my sparse detail page for it here:

-- LesOrchard - 20 Feb 2002

Very interesting, have commented over on JspWiki. Looks quite simple to implement, which is a big plus IMO! I'm a bit confused by the code's use of the SOAP library though, is this just for some low level functions?

One benefit of XmlRpc is that it seems much lower overhead than SOAP, hence it would work better for low-end clients such as PDAs and Java Phones - perhaps this could help implement a ReadWriteOfflineWiki and TWikiOnPDAs. See Enhydra's kXML-RPC work for more info.

-- RichardDonkin - 21 Feb 2002

Yes, the use of the SOAP code is for specifying particular XML-RPC data types that are not automatically translated by the module in method return values. The XMLRPC::Lite module I use is a part of the SOAP::Lite package, just with XML-RPC specific serializers and transports. The good thing about this crossover is that it shouldn't be too hard to massage this script into a SOAP interface, I think. Might just be a matter of replacing "use XMLRPC::Transport::HTTP" with "use SOAP::Transport::HTTP"

-- LesOrchard - 21 Feb 2002

Links

Apache RPC http://xml.apache.org/xmlrpc/

http://kxmlrpc.enhydra.org/project/aboutProject/

http://www.decafbad.com/twiki/bin/view/Main/XmlRpcToWiki

http://www.xmlrpc.com/spec

-- DennisDaniels - 21 Mar 2002

see also VoodooPad and VoodooPadXmlRpcAddOn ( and VoodooPadXmlRpcAddOnDev )

-- WillNorris - 17 Jan 2004

Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2004-02-16 - SvenDowideit
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.