ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Langer">
Subject Always get "unknown method" with PHP server
Date Wed, 19 May 2004 09:32:14 GMT
Hi there!

I'm about to implement some communication between a PHP XML-RPC server and a Java client.
The server is doing fine, a PHP client is working perfectly, but I just can't get a Java client
to work. Every time I get a "Error: Unknown method".

I'm now at a point where I try to connect to a PHP server sample script, which looks like


function sumAndDifference($params) {
$xval = $params->getParam(0); 
$x = $xval->scalarval();
$yval = $params->getParam(1);
$y = $yval->scalaraval();

$struct = array('sum' => new XML_RPC_Value($x + $y, 'int'),
'difference' => new XML_RPC_Value($x - $y, 'int'));
return new XML_RPC_Response(new XML_RPC_Value($struct, 'struct'));

$sumAndDifference_sig = array(array('struct', 'int', 'int'));
$sumAndDifference_doc = 'Add and subtract two numbers';

new XML_RPC_Server(array('sample.sumAndDifference' =>
array('function' => 'sumAndDifference',
'signature' => $sumAndDifference_sig,
'docstring' => $sumAndDifference_doc))); 


After that I tried to connect for debug purposes, but I only got this:

C:\work\pfc\dev\Process_Viewer\classes>java org.apache.xmlrpc.XmlRpcClient http://localhost/pfl/server-test.php
sample.sumAndDifference 1 3
Error: Unknown method

Has anyone an idea of what I may be doing wrong?
I'm using current versions of the java library as well as the PEAR PHP module...

View raw message