Documentation section

The Reference Guide (API Description / Tutorials / Essays) Under Construction
More documentation needs to be written... :-(

What is XML-RPC ?

It is a way of communicating over the internet. It is an agreement on sending structured data(e.g. Arrays, Structs, strings) encoded in XML to a Server. An XML-RPC Message is received back as a response which also contains structured data.

*UPDATED* API

This section is up to date with the changes in version 0.91 everything else on the site isn't. (sorry)
Simple Synchronous Example of the vcXMLRPC API.

function displayNews(data){
   //Handle incoming news
}

oStruct = {
   //Build the struct according to the Meerkat API
}
result = XMLRPC.call("http://www.oreillynet.com/meerkat/xml-rpc/server.php", "meerkat.getItems", oStruct);
displayNews(result);

Simple a-Synchronous Example of the vcXMLRPC API.

//The Same as above with one exception
result = XMLRPC.call(displayNews, "http://www.oreillynet.com/meerkat/xml-rpc/server.php", "meerkat.getItems", oStruct);

Advanced Example of the vcXMLRPC API.

//Set up routing.
XMLRPC.routeServer = "http://www.vcdn.org/cgi-bin/rpcroute.cgi";
XMLRPC.autoroute = true;//possible values: boolean (true/false) default = true

//Set the Meerkat service API.
meerkat = XMLRPC.getService("http://www.oreillynet.com/meerkat/xml-rpc/server.php");
meerkat.add("meerkat.getItems", "getNews");

//Set up multicall support
meerkat.multicall = true;

//Set up the Error handling.
XMLRPC.onerror = function(e){
   alert("An error has occured: " + e.message);
   return true;
}

XMLRPC.ontimeout = function(){
   alert("This call has timed out, please retry!");
   return true;
}

//Call the XMLRPC Service.
oStruct = {
   //Build the struct according to the Meerkat API
}
oResult = meerkat.getNews(oStruct);

//Purge the multiple calls
oResult = meerkat.purge(displaynews);//The receive function is optional

/*Whenever a receive function is given as a first argument
to the functions purge or call, async transfer is assumed*/


The (unfinished) Reference Guide has more information.

Routing

Text from the rpcroute.cgi file

Both Internet Explorer and Mozilla have the feature to send a custom http message directly from the browser. These are secured features which in first only allow you to send the message to the server where the file is located that wants to send the message. A routing feature is implemented in vcXMLRPC to be able to send messages to other services by routing it via the server.
This routing feature is implemented very easily. It consists of a perl script which is placed in your cgi-bin. Then just set the routeServer property to the url of the script and it works!
Internet Explorer can be used to send XML-RPC messages directly to foreign servers. This is only possible when the domain is placed in the trusted sites section. This is done via Tools - Internet Options - Security.

Base64

a Base64 feature is now implemented. It currently only decodes and not encodes. If you want an Base64 encoding feature implemented let us know.

vcXMLRPC v0.80 works as tested, with the following browsers:

  • Internet Explorer 5.0/5.5/6.0 on Windows 2000
    (expected to run on all windows platforms)

  • Mozilla Build ID (2001080716) on Windows 2000
    (expected to work as of version 20010308, or when the XML-Extras are manually installed)

  • Mozilla 0.9.4 on RedHat Linux 7.1
(let us know if it works on a browser which isn't in the list!).
 vcXMLRPC© 1999-2001 Virtual Cowboys  |  We thank our host: Helder Hosting