XML-RPC: a Next-Generation Web API
Simple, elegant, and useful applications of Internet technology always put a smile on my face. One such application is running at http://www.mailtothefuture.com/. It enables you to send mail to yourself (or, actually, anyone) at some future date.
This is an interactive application that, because it’s a CGI-based web service, I could with a little effort also use as an HTTP-based reminder component built into a groupware or workflow system of my own devising. To do that, I’d follow the procedures outlined earlier: discover the web API, and write a script to control it.
But the author of MailToTheFuture, Dave Winer, has taken this game to a new level. A pioneer in understanding and applying XML, Dave cooked up a marvelously simple and elegant idea that he calls XML-RPC (see http://www.scripting.com/frontier5/xml/code/rpc.html). In a nutshell, it’s a way of formalizing the CGI interface to a web-based service using XML to define both the methods supported by a service and the data marshaling used when communicating with a service.
The architecture of XML-RPC is gloriously simple. A service that supports XML-RPC, such as MailToTheFuture, responds to method calls that are nothing more than HTTP POST requests with XML-formatted payloads. For example, to add a new message to your queue at MailToTheFuture, you invoke the method:
mailToTheFuture.addMessage(username, password, msgstruct)
To use this method, you post an XML-RPC request that expresses that ...