XML-RPC via Alternate Transports
*** The reasoning
XML-RPC is designed to send a mime formatted message from computer to
computer via a http connection.
But alas, not everyone has connections that are sufficiently reliable to rely on
a tcp-ip connection. (such as one provided by PacBell, UsWest, Flashcom,or Conaxion) For some applications, encapsulating the xml-rpc message in
alternate transports is a necessary or acceptable alternative.
This specification covers the implementation of xml-rpc over such non-ip
based transports such as: Zip disk/Sneakernet, postit note/felines, and
small print/homing pigeon. These are not all desirable vectors, but if you
don’t have a tcp-ip connection, you don’t have a whole lot of choice, do
you?
There are some issues that need to be addressed. Once an immediate
connection is changed to an asynchronous one, there is a chance that a
failure will occur without the knowledge of either the client or the server.
For example, mixing the feline and pigeon vectors could have disastrous
results. Care should be taken at the api level to ensure that an
acceptable error mechanism is provided.
*** The spec
The request is of the form:
-- transport dependant information here. -- Mime-Version: 1.0 Content-Type: text/xml; charset=us-ascii <?xml version="1.0"?> <methodCall> <methodName>examples.getStateName</methodName> <params> <param> <value><i4>5</i4></value> </param> </params> </methodCall>
The essential portions of this are:
- Content Type: text/xml, to distinguish it from plaintext
- Body: this is straight from the rpc spec
A Sample Reply
-- transport dependant information here. -- Mime-Version: 1.0 Content-Type: text/xml; charset=us-ascii <?xml version="1.0"?> <methodResponse> <params> <param> <value>California</value> </param> </params> </methodResponse>
*** The implementation
Zip Disk/sneakernet
Of the alternatives presented, this is the most attractive. As the
immortal spaf was heard to utter way back when, “Never underestimate the
bandwidth of a trunkload of backup tapes.” This is a nearly infinite
bandwidth solution, limited only by the removable media capacity on either
end of the connection. The xml-rpc requests are written as a mime formatted
text file, and loaded on the other end. Replies are at the discretion of
the server.
Postit note/feline
This is perhaps the least effective method of getting the message across,
although it does have side effect benefits of amusing the feline owner and
passers by. Experimental evidence has shown the following: postit notes
stick reasonably well to the fur of Maine coon cats (MTBF, 20 minutes), and when put in an
area where the only off limits area is the server room, the cats will
gravitate to that room. Therefore, printing mime formatted messages on
postit notes and affixing them to cats will have a non zero probability of
the message reaching the server. However, it’s probably faster to get up
and go over to the console yourself. Warning, this could be dangerous with
surly cats.
Small Print/homing pigeon
The final method offered for review is xml-rpc via homing pigeon. Print out
a mime formatted message and affix it to a pigeon’s leg using Simpson’s
Individual Stringetts(tm). This method is not suitable for larger
messages, as it could affect the airspeed velocity of the pigeon, causing
it to not so much fly as plummet. Pigeons can be surprisingly fast
delivery vectors, although they tend to be rather imprinted for one way
delivery to a specific destination. Return messages can be delivered by
additional trained birds.
*** The Demo
I’m sorry that I don’t have a demo set up, although I’ll try to get a
picture of the cats.
*** The Caveats
This is a joke. It may work on my machine, but I wouldn’t bet on it. Any
resemblance to any spec, living or dead, is purely an aberration. However,
I wasn’t kidding about the postit notes. Actually, the sneaker net thing
would work, but there are better ways to do this.
*** The Legal Stuff
There is no warranty. There is no patent. If you use these ideas, you’re a
far braver man than I. My employer, “Socialecology”, has no foreknowledge of
this posting, and if they did, they’re probably humming tiddely-pom while
standing around trying very hard not to watch like this is some major accident.