Java Reference
In-Depth Information
The XML-RPC server is at http://www.advogato.org/XMLRPC (lines 1-2).
n
The remote method being called is test.square (line 10).
n
The method is being called with one argument, an integer with a value of 13 (lines
12-16).
n
Unlike their counterparts in Java, method names in an XML-RPC request do not include
parentheses. They consist of the name of an object followed by a period and the name of
the method or simply the name of the method, depending on the XML-RPC server.
CAUTION
XML-RPC, which has been implemented in numerous computer-pro-
gramming languages, has a few differences in terminology than
Java: Methods are called procedures , and method arguments are
called parameters . The Java terms are used often during today's
lesson when Java programming techniques are discussed.
Responding to a Request
An XML-RPC response is XML data that is sent back from a web server like any other
HTTP response. Again, XML-RPC piggybacks on top of an established process—a web
server sending data via HTTP to a web browser—and uses it in a new way.
The response also consists of HTTP headers and an XML-RPC response in XML format.
Listing 20.2 contains an example of an XML-RPC response.
LISTING 20.2
An XML-RPC Response
1: HTTP/1.0 200 OK
2: Date: Sun, 03 Mar 2007 19:17:11 GMT
3: Server: Apache/1.3.26 (Unix) mod_virgule/1.41 PHP/4.1.2 mod_perl/1.26
4: ETag: “PbT9cMgXsXnw52OqREFNAA==”
5: Content-MD5: PbT9cMgXsXnw52OqREFNAA==
6: Content-Length: 157
7: Connection: close
8: Content-Type: text/xml
9:
10: <?xml version=”1.0”?>
11: <methodResponse>
12: <params>
13: <param>
14: <value>
15: <int>169</int>
20
 
Search WWH ::




Custom Search