Developing with XML-RPC

Using XML-RPC in your applications generally means adding an XML-RPC library and making some of your function calls through that library. Creating functions that will work smoothly with XML-RPC requires writing code that uses only the basic types XML-RPC supports. Otherwise, there is very little fundamental need to change your coding style. Adding XML-RPC support may require writing some wrapper code that connects your code with the library, but this generally isn’t very difficult.

Tip

As XML-RPC becomes more and more widespread, some environments are building in XML-RPC. UserLand Frontier has done that for years, while the Perl and Python communities are discussing similar integration.

To demonstrate XML-RPC, we’re going to create a server that uses Java to process XML-RPC messages, and Java and Perl clients to call procedures on that server. Although this demonstration is simple, it illustrates the connections needed to establish communications between programs using XML-RPC.

The Java side of the conversation uses the Apache XML Project’s Apache XML-RPC, available at http://xml.apache.org/xmlrpc/. The Apache package includes a few key pieces that make integrating XML-RPC with Java easier:

  • An automated registration process for adding methods to the XML-RPC server

  • A built-in server that only speaks XML-RPC, reducing the need to create full-blown servlets

  • A client package that makes calling remote methods fairly simple

This demonstration will use a procedure ...

Get Web Services Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.