Hi, everyone,
I'm using Edd Dumbill's XML-RPC distribution for PHP, and I think I have what is a simple problem, but I just can't figure it out. I've got this code as a server:
<?
include("xmlrpc.inc");
include("xmlrpcs.inc");
function addem($m) {
$num1 = xmlrpc_decode($m->getParam(0));
$num2 = xmlrpc_decode($m->getParam(1));
$temp = "$num1 plus $num2 is equal to ";
$temp .= $num1 + $num2;
$r = new xmlrpcresp(new xmlrpcval($temp, $xmlrpcstring));
}
$disp_map = array( "examples.addEm" =>
array("function" => "addem"));
$s = new xmlrpc_server($disp_map);
?>
For the client, I've got some Perl code:
#!/usr/bin/perl -w
use strict;
use Frontier::Client;
my $client = Frontier::Client->new
( url => "http://www.disserto.com/xmlrpc/addition.php",
debug => 1);
print $client->call('examples.addEm', 3, 5), "\n";
exit (0);
Pretty simple, right? Here's my results:
---- request ----
<?xml version="1.0"?>
<methodCall>
<methodName>examples.addEm</methodName>
<params>
<param><value><i4>3</i4></value></param>
<param><value><i4>5</i4></value></param>
</params>
</methodCall>
---- response ----
<br />
<b>Fatal error</b>: Call to a member function on a non-object in <b>/web/disserto/docs/include/xmlrpcs.inc</b> on line <b>176</b><br />
unknown RPC type `br'
at line 1 column 0
Another error I frequently get is this:
Incorrect parameters passed to method: Wanted , got at param )
The error message is very little help.
I'm lost. Any thoughts?
Thanks!
Sean