RPC::XML Client and Data Classes

This section describes the RPC::XML::Client class, the RPC::XML::request class, and data classes.

RPC::XML also offers the client, request and data classes:

RPC::XML::int - A data class representing the XML-RPC '*.value.int' element. It supports the following methods:

new($value) - Constructs and returns a XML-RPC 'int' object with the specified value.

type() - Returns the data type name as a string.

value() - Returns the value as a string

RPC::XML::$valueType - Other data classes representing other XML-RPC value type elements. All data classes supports the same methods as the RPC::XML::int class. For RPC::XML::array or RPC::XML::struct, method value() will return a reference of array or hash.

RPC::XML::request - A message class representing the XML-RPC 'methodCall' element. It supports the following methods:

new('methodName', param1, param2, ...) - Constructs and returns a XML-RPC request object with the specified method name and parameters. Specified parameters must be objects of RPC::XML data classes. The following statement shows you how to construct a request:

   $request = RPC::XML::request->new('com.herong.getCelsius',
      RPC::XML:double->new('100.0'));

as_string() - Returns the XML string representation of the request.

RPC::XML::Client - A XML-RPC client and programming interface for connecting to the server, sending method calls, and receiving returning values. It supports the following methods:

new('url') - Constructs and returns a XML-RPC client object that connects to a server at the specified URL.

send_request($request) - Sends the specified request to the server, and returns a RPC::XML data object representing the only "param" returned in the XML-RPC response. Here is an example of how to use send_request():

   $res = $client->send_request($request);

Table of Contents

 About This Book

 Perl on Linux Systems

 ActivePerl on Windows Systems

 Data Types: Values and Variables

 Expressions, Operations and Simple Statements

 User Defined Subroutines

 Perl Built-in Debugger

 Name Spaces and Perl Module Files

 Symbolic (or Soft) References

 Hard References - Addresses of Memory Objects

 Objects (or References) and Classes (or Packages)

 Typeglob and Importing Identifiers from Other Packages

 String Built-in Functions and Performance

 File Handles and Data Input/Output

 Open Files in Binary Mode

 Open Directories and Read File Names

 File System Functions and Operations

 Converting Perl Script to Executable Binary

 Using DBM Database Files

 Using MySQL Database Server

 Socket Communication Over the Internet

 XML::Simple Module - XML Parser and Generator

 XML Communication Model

 SOAP::Lite - SOAP Server-Client Communication Module

 Perl Programs as IIS Server CGI Scripts

 CGI (Common Gateway Interface)

 XML-RPC - Remote Procedure Call with XML and HTTP

RPC::XML - Perl Implementation of XML-RPC

 What Is RPC::XML?

 RPC::XML::Server - XML-RPC Server Interface Class

RPC::XML Client and Data Classes

 Installing NMake 1.5

 Installing RPC::XML Module

 RpcXmlServer.pl - RPC::XML Server Sample Program

 RpcXmlClient.pl - RPC::XML Client Sample Program

 Sending Arrays with Remote Method Calls

 Integrating Perl with Apache Web Server

 CGI.pm Module for Building Web Pages

 LWP::UserAgent and Web Site Testing

 References

 PDF Printing Version