Ruby Developer's Guide

In this chapter we'll introduce you into three libraries, XML-RPC for Ruby (xmlrpc4r), Simple Object Access Protocol for Ruby (SOAP4R) and Distributed Ruby (DRb). The first two are interfaces to XML-RPC and SOAP, which are XML-based and language-independent protocols; both are used for writing or accessing Web services. The third library is a pure Ruby solution for remote method calls, and is limited to Ruby That is, it's not possible to write a client or a server in a language other than Ruby using Distributed Ruby.
We can monitor Web services, or any TCP/IP-based client and server, by using a very simple monitor application that comes with XML-RPC for Ruby (see file samples/monitor/monitor.rb) or TCPSocketPipe (available from the Ruby Application Archive [RAA]).
Suppose you are running a SOAP service on port 8070. To display the traffic between that service and a SOAP client, start the monitor with the following:
ruby monitor.rb 8060 localhost 8070
The SOAP client should now access the service through port 8060 instead of port 8070.
In addition to the graphical user interface (GUI) displaying the traffic, a hex dump of the TCP/IP traffic and some logging messages are stored in the directory's TCPSocketPipe.log file.
XML-RPC takes a pragmatic approach to distributed computing between different systems and languages, based on two major Internet standards: HTTP for transmission, and XML to encode information in a human-readable and portable way.
XML-RPC's specification (see www.xmlrpc.com/spec) defines a...