Hi all,
I've created a Zend_XmlRpc_Server, like so:
require_once "Zend/XmlRpc/Server.php";
function echoTest()
{
return "Hello, world";
}
$server = new Zend_XmlRpc_Server();
$server->addFunction("echoTest");
echo $server->handle();
Calling the "echoTest" method using Zend_XmlRpc_Client works fine
like this:
require_once 'Zend/XmlRpc/Client.php';
$client = new Zend_XmlRpc_Client('http://myhostname/index.php');
print_r($client->call('echoTest'));
This definitely works, I get "Hello, world" in the browser.
However, if I add a parameter to the echoTest method like so:
function echoTest($textToEcho)
{
return "You said: " . $textToEcho;
}
and call it using the client class like this this:
require_once 'Zend/XmlRpc/Client.php';
$client = new Zend_XmlRpc_Client('http://myhostname/index.php');
print_r($client->call('echoTest', array("HELLO WORLD!")));
I get the following exception:
Fatal error: Uncaught exception 'Zend_XmlRpc_Client_FaultException'
with message 'Calling parameters do not match signature' in /usr/
local/include/php/php-5.2.3/zend_framework_co/library/Zend/XmlRpc/
Client.php:261 Stack trace: #0 /private/var/www/VirtualHosts/
myhostname/public/phpclient.php(5): Zend_XmlRpc_Client->call
('echoTest', Array) #1 {main} thrown in /usr/local/include/php/
php-5.2.3/zend_framework_co/library/Zend/XmlRpc/Client.php on line 261
It seems adding any parameter to a method or function causes this
error. Functions/methods with no parameters always work.
I've been trying to get it to work for hours, and consulted the docs
(even copied examples from the docs) but I always get this error. I'm
using php 5.2.3 and apache 2, but have also tried it on a different
server with php 5.1.6.
I have tried using Zend Framework from svn trunk, but that doesn't
fix it either.
Am I missing something very fundamental?
--
Nilesh Ashra // POKE // Biscuit Building // 10 Redchurch Street // E2
7DD // 07736 283320