Programming Web Services with XML-RPC by Simon St.Laurent, Joe Johnston & Edd Dumbill Unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. This page was updated June 20, 2003. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification UNCONFIRMED errors and comments from readers: (ix) 3rd paragraph; 4th line of graf - "if we would like work with them" is missing "to" (or commas, if you're trying for an old 'valley-girl' dialect). (xi) 4th Paragraph; The first sentence is missing the word "is". It reads: "So in my humble opinion, XML-RPC the ultimate leveler. There should be an "is" between "XML-RPC" and "the". [1] Chapter 4, XML-RPC and Perl; The end of chapter 4, XML-RPC and Perl, talks about a Perl package named Frontier::Responder. To my knowledge, no such package exists (at least on CPAN). The Frontier packages include Frontier::Client, Frontier::Daemon and Frontier::RPC2::, all of which seem properly documented and discussed in this chapter of the book. However, there is no Frontier::Responder. Further, the Frontier:: packages have not changed in nearly 3 years, so I wonder how such misinformation could have arisen? (5) 3rd paragraph; At the end of the fourth line, there is a hyphen unnecessarily appended to "work", so that the sentence reads "Even if you work-within a single environment, you may find..." (19) Last paragraph; There is a space missing between the words "circumstance" and "and", so that the sentence reads "From this circumstanceand the practical consideration that all..." (34) 3rd paragraph; environmentsXML-RPC's use should be environments. XML-RPC's use (34) last paragraph; betweensystems should be between systems [40] Table 3-1; XML-RPC types for helma.xmlrpc (now apache XML-RPC) not support the type nil (extension)! [50] first example source code; The correct method for testing equality of two strings in Java is: if (methodName.equals("nameTester")) { ... instead of if (methodName=="nameTester") { ... which only tests, if the String methodName and the String "nameTester" have the same address in memory. [50] last but one line; The correct method to test two strings for equality in Java is: if (methodName.equals("nameTester")) { ... instead of if (methodName=="nameTester") { ... which only tests, if the String methodName and the String "nameTester" have the same address. (55) lower part of source code; The statement Object result = client.execute("area.anyArea", params) differs from the preceding example and should be hightlighted. (58) 8th line; "Usage: java AreaServer [port]"); should be "Usage: java XLogServer[port]"); (79) 3rd paragraph; The first sentence begins "When a users come to work ..." It should begin "When users come to work ..." {81} 3rd line of source code example; The hash key "method" has to be "methods". (81) last but one paragraph, second sentence; "The Daemon object takes this value and it sends back ..." should be "The Daemon object takes this value and sends it back ..." (86) paragraph in the middle of the page beginning with "The SUM() ..."; The third sentence of this paragraph contains a formatting error: The phrase "fetches the result" should not be printed with constant width. {87} source code snippet at the bottom of the page; To actually create a hash reference, the parentheses has to be replaced by curly braces: $map = { punch_in => \&punch_clock, ... }; [87] code snip; the $map should be a Hash %map or %method (since map is a perl keyword). Frontier::Responder is available here: http://www.taskboy.com/programs/Frontier_Responder/ with the following Synopsis: -------- SYNOPSIS use Frontier::Responder; my %methods = ( add => sub{ $_[0] + $_[1] }, cat => sub{ $_[0] . $_[1] }, ); my $res = Frontier::Responder->new( methods => \%methods, ); print $res->answer; ------- substituting the sub{ block }, with a sub ref \&add or as the book indicates: \&punch_clock you will have working code. {94} 1. paragraph; In the first example that tests for a XMLRPC scalar value, it should say : if ($xv- >kindOf()=="scalar"){. Instead it says : if($xv->kindOf=="scalar"){. [97] 5th paragraph; The text reads: "Subsequent parameters can also be added in order to the message by use of the addParam() method, which takes exactly one xmlrpcval object as its argument" While the above statement is technically correct, IMHO a bit more explanation regarding non-array params should be added. I am using PHP include file xmlrpc.inc, v 1.18, 2001/07/06 and I have found from usage and reviewing the xmlrpc.inc source that only array type params are added to a new xmlrpcmsg in the xmlrpcmsg constructor. Single scalar types must be added using xmlrpcmsg->addParam(). Inclusion of this bit of info in the book would be helpful IMHO. {103} first code example on the bottom; The server includes for a php server are: include("xmlrpc.inc"); include("xmlrpcs.inc"); not: include("xmlrpc.inc"); include("xmlrpc.inc"); (They forgot the s on the secound include.) (122) 8th-last line; import xmlrpc, time should be import xmlrpclib, time (145) Second paragraph from the bottom; There is a space missing between "suffices" and "for" in the third sentence, which reads "A simple web page often sufficesfor this." {147} Code example at foot of page; The code is an example of how to build an XML-RPC listener in ASP and VBScript. However, the addServerFunction command is missing from the code as listed and my attempts to build something similar would not work until I added this. Not sure if this is an omission in the book as my code is different in its function, but thought it was worth pointing out. {151} In example 7-5; The grammar is incorrect in the following commment: ' First, if a record exist with this key, abort I believe it should be "exists". (182) Third paragraph, first sentence; the word frequnetly has the characters 'n' and 'e' tranposed.