2. What is XML-RPC?XML-RPC is a simple, portable way to make remote procedure calls over HTTP. It can be used with Perl, Java, Python, C, C++, PHP and many other programming languages. Implementations are available for Unix, Windows and the Macintosh. Here's a short XML-RPC client written in Perl. (We use Ken MacLeod's Frontier::Client module.)
When run, this program will connect to the remote server, get the state name, and print it. (State #41 should be South Dakota in this example.) Here's the same program in Python. (This time, we use Fredrik Lundh's xmlrpclib.)
In the following chapters, you'll learn how to write XML-RPC clients and servers in a variety of programming languages. 2.1. How it WorksXML-RPC is described fully in Dave Winer's official specification. If you're curious, go ahead and take a look—it's a quick and straight-forward read. On the wire, XML-RPC values are encoded as XML:
This is verbose, but compresses readily. It's also faster than you might expect—according to measurements by Rick Blair, a round-trip XML-RPC call takes 3 milliseconds using Hannes Wallnöfer's Java implementation. 2.2. Supported Data TypesXML-RPC supports the following data types:
2.3. The History of XML-RPCXML-RPC was inspired by two earlier protocols. The first is an anonymous RPC protocol designed by Dave Winer and announced in an old DaveNet essay. (This is why XML-RPC servers are often installed under /RPC2.) The other, more important inspiration was an early draft of the SOAP protocol. A longer history of XML-RPC has been generously provided by Dave Winer. This also explains the relationship between XML-RPC and SOAP. Linux HOWTO full list |
|
This document, LDP HOWTO-INDEX, is copyrighted (c) 1995 - 2002 by Tim Bynum, Guylhem Aznar, Joshua Drake and Greg Ferguson. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html. If you have questions, please contact the LDP.
Web Design Copyright © 1999-2003. Chrisranjana Software Solutions Pvt Ltd. syndicate rss feed |