Hi
I am a newbie to the zend framework
I am trying to implement a webservice to update one of my database tables
for my domain smileeholidays.com. I am running the client from another
domain http://abudhabi.fundook.com.
When I run the client, I got error as
An exception occurred: Calling parameters do not match signature
Last Request: email.siteVisit44814
Last REsponse:
I had written the client part as c Controller and action. It is provided
below.
function responseAction()
{
Zend_Loader::loadClass('Zend_XmlRpc_Client');
$response_id =
$this->_request->getParam('response_id');
try {
$client = new
Zend_XmlRpc_Client('http://smileeholidays.com/Fundook/xmlrpc');
$result = $client->call('email.siteVisit',
$response_id);
} catch (Zend_XmlRpc_Client_FaultException $e) {
echo "An exception occurred: " . $e->getMessage() . "\n\n";
}
echo "<br/>Last Request: ",
$client->getLastRequest()->__toString();
echo "<br/>Last REsponse: ",
$client->getLastResponse()->__toString();
}
and I on the server side, on the root dir, i had created a folder called
xmlrpc an inside of that, I had placed four files
1) .htaccess
2) index.php which is exactly as
<?php
include 'Bootstrap.php';
set_include_path('.' . PATH_SEPARATOR . '../library/'
. PATH_SEPARATOR . '../application/models'
. PATH_SEPARATOR . get_include_path());
include "Zend/Loader.php";
Zend_Loader::loadClass('Zend_XmlRpc_Server');
Zend_Loader::loadClass('Zend_Server_Abstract');
$bootstrap = new Bootstrap('general');
$bootstrap->runXmlRpc();
?>
3) Bootstrap.php which looks like
<?
class Bootstrap
{
public function __construct($deploymentEnvironment)
{
// Set up any configuration settings here
}
public function runXmlRpc()
{
$server = new Zend_XmlRpc_Server();
require_once 'Emails.php';
$server->setClass('Emails','email');
$response = $server->handle();
$response->setEncoding('UTF-8');
header('Content-Type: text/xml; charset=UTF-8');
echo $response;
}
}
?>
and
4) <?php
class Emails
{
/**
* Echo back a integer
*
* @param integer $response_id
* @return integer
*/
public function siteVisit($response_id)
{
$con = mysql_connect('serverIp','uname','passwd');
if(!$con)
{
echo "Error - cannot connect to host";
exit;
}
$db =mysql_select_db('dbname',$con);
if(!$db)
{
echo "Error - cannot connect to database";
exit;
}
$sql = "UPDATE emails SET `ads_added`=2 WHERE
id =".$response_id;
mysql_query($sql);
return $response_id;
}
}
?>
Anyone know what is wrong in my code. Please help ASAP...
Regards
Anz
--
View this message in context:
http://www.nabble.com/Zend_XmlRpc_Client_FaultException%27-with-message-%27Calling-parameters-do-not-match-signature-tp23018211p23018211.html
Sent from the Zend Framework mailing list archive at Nabble.com.