Perl Tutorials - Herong's Tutorial Examples - v6.01, by Dr. Herong Yang
Defining Returning Values of a Remote Method Call
This section describes how returning values of a remote method call can be defined in XML format. The root element name is 'methodResponse'.
The third item of the XML-RPC specification is about how to define returning values of a remote method call in XML format.
XML-RPC defines returning values of a method call as an XML element called "methodResponse". The structure of "methodResponse is very similar to "methodCall". But only one "param" is allowed inside "params" as shown in the following XSD file:
<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!-- xmlRpcMethodResponse.xsd Copyright (c) HerongYang.com. All Rights Reserved. --> <xsd:element name="methodResponse" type="methodResponseType"/> <xsd:complexType name="methodResponseType"> <xsd:sequence> <xsd:element name="params" type="paramsType" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="paramsType"> <xsd:sequence> <xsd:element name="param" type="paramType" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> ...... </xsd:schema>
Here is an example of "methodResponse":
<methodResponse> <params> <param><value><array><data> <value><string>Bush</string></value> <value><string>Gate</string></value> <value><string>Yang</string></value> </data></struct></value></param> </params> </methodResponse>
Table of Contents
Data Types: Values and Variables
Expressions, Operations and Simple Statements
Name Spaces and Perl Module Files
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 Directories and Read File Names
File System Functions and Operations
Socket Communication Over the Internet
XML::Simple Module - XML Parser and Generator
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
Defining a Remote Method Call in XML
Sending a Remote Method Call as a HTTP Request
►Defining Returning Values of a Remote Method Call
Receiving Returning Values as a HTTP Response
RPC::XML - Perl Implementation of XML-RPC
Integrating Perl with Apache Web Server
CGI.pm Module for Building Web Pages
LWP::UserAgent and Web Site Testing
Converting Perl Script to Executable Binary