The XMLRPC::Lite package and related classes are part of the larger SOAP::Lite package, which is described in greater detail in Appendix B. The coverage will focus on only the XML-RPC aspects. Many classes described here inherit from SOAP::Lite counterparts. In these cases a basic definition is provided, leaving the main definitions to accompany their classes in Appendix B. The following is based on Release 0.55 of SOAP::Lite . A.2.1 XMLRPC::LiteThe following classes are all made available by loading the XMLRPC::Lite module. There are also some behind-the-scenes classes that aren't documented here, because they aren't intended to be replaced or extended. A.2.1.1 XMLRPC::LiteInherits from: SOAP::Lite . This class is used for creating client objects that in turn communicate with remote servers. There are more methods available to this class than are listed here, because it inherits directly from SOAP::Lite . Many methods in that class aren't relevant to implementing XML-RPC, so the object attributes they manipulate are ignored by the serializer. One noteworthy feature that XMLRPC::Lite inherits from its parent class is the automatic creation of object as needed, when methods are called as class methods. In most applications, an explicit creation of the client object with new is generally not needed. Some of the methods may also be used at compile-time to influence global behavior. This will be explained after the method listing. All methods return the object reference on success unless otherwise specified. Errors trigger either the fault handler or a call to die .
A.2.1.2 XMLRPC::DataInherits from: SOAP::Data . The XMLRPC::Data class is made available to aid in serializing Perl data that is ambiguous enough that the serializer can't always automatically identify the type. Unlike SOAP, data in XML-RPC is relatively free of metadata, so using this class is much simpler and clearer than its parent class. Objects need only be created when the value in question needs explicit typing. Once an object is created, the type and value may be manipulated with these methods:
XMLRPC::Data objects may be passed as parameters when using the call method on a XMLRPC::Lite object (or when using the indirect or autodispatch approaches). A.2.1.3 XMLRPC::SOMInherits from: SOAP::SOM . All values returned from calls made by a client object are instances of this class. While this class has access to all the methods from SOAP::SOM, the convenience methods listed here are recommended rather than using match and valueof with various arguments.
The following are the supported convenience methods that return data in Perl format rather than serialized or object-encapsulated format.
The following two methods provide access to the parameter lists of XMLRPC::SOM objects. They are defined here because they behave slightly differently from the inherited methods by the same name in SOAP::SOM .
A.2.1.4 XMLRPC::Deserializer and XMLRPC::SerializerInherits from: SOAP::Deserializer and SOAP::Serializer , respectively. The deserialization object is used by both client and server objects to transform XML messages into Perl data, while the serialization object transforms requests and responses from Perl data to XML messages. XML-RPC is much more stringent than SOAP because there are no permitted alternatives for encoding; for this reason, application developers shouldn't need to subclass or otherwise alter these objects. However, if such a need arises, you use the same set of methods as their SOAP::Lite counterparts, with some overridden for XML-RPC application. A.2.1.5 XMLRPC::ServerInherits from: SOAP::Server . This class derives from the SOAP::Lite equivalent and overrides the initialization code to provide functionality geared towards XML-RPC. It isn't meant to be used directly by application developers but rather allows the server classes that are defined later a common initialization method that can be shared. A.2.1.6 XMLRPC::Server::ParametersInherits from: SOAP::Server::Parameters . This is an empty class for use when writing code for deployment through a server based on the XMLRPC::Server class. It inherits two methods from the parent class, but the primary purpose is to be a superclass to code written for a XML-RPC server. When a server derived from the server classes (that are detailed later) dispatches an incoming request, it checks to see if the class to which the receiving method belongs inherits from this class. If so, the XMLRPC::SOM object that represents the message's envelope is added at the end of the list of parameters to the local subroutine call. A.2.2 XMLRPC::Transport::HTTPThis module provides the implementation of HTTP transport for servers. Clients don't use modules from the XMLRPC::Transport::* hierarchy because they can use the same transport code SOAP::Lite does. This module provides three different server classes to use either directly or as parent classes for new code. All three classes inherit from their SOAP::Lite counterparts. None define any new methods of their own; methods should be taken from the class listings in Appendix B. In particular, the methods of note for the classes used for XML-RPC serving are new , dispatch_to , and handle . A.2.2.1 XMLRPC::Transport::HTTP::CGIInherits from: SOAP::Transport::HTTP::CGI . This class is designed for use in standard CGI environments. A.2.2.2 XMLRPC::Transport::HTTP::DaemonInherits from: SOAP::Transport::HTTP::Daemon . The implementation of this class uses an object of the HTTP::Daemon class, from the LWP module, to provide the actual server functionality. A.2.2.3 XMLRPC::Transport::HTTP::ApacheInherits from: SOAP::Transport::HTTP::Apache . This class is designed to work as a basis for an Apache/ mod_perl content handler that serves XML-RPC requests. It doesn't operate in quite the same way as the daemon-based server described earlier; it expects the traditional server loop functionality to be handled by Apache rather than within the class. A.2.3 XMLRPC::Transport::POP3This module provides just the XMLRPC::Transport::POP3::Server class, which inherits from SOAP::Transport::POP3::Server . It implements a XML-RPC server that reads the incoming messages from a POP3 mailbox. XML-RPC clients may use the mailto: scheme to send such requests. A.2.4 XMLRPC::Transport::TCPThis module provides just a XMLRPC::Transport::TCP::Server class, which inherits from SOAP::Transport::TCP::Server in this case. This implements a server that uses straight TCP/IP rather than HTTP for communication. Clients may also use a scheme of tcp: to communicate with such servers. |