単純なクライアント/サーバーXMLRPCサーバーのセットアップを取得しようとしていますが、パラメーターの使用に問題があります。$ client_idパラメーターをfetchClient()メソッドから取り出して$ client-> call()を実行すると、コードは正常に実行されます。ただし、これを含めると、サーバーは「呼び出し元のパラメーターが署名と一致しません」を返します。
コントローラーコード:
class XmlrpcController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
}
public function indexAction()
{
$server = new Zend_XmlRpc_Server();
$server->setClass('App_Service_Customer','customer');
echo $server->handle();
}
}
App / Service / Customer.php:
class App_Service_Customer
{
/**
* @param int $client_id
* @return string
*/
public function fetchCustomer($client_id)
{
return 'john doe';
}
}
クライアントテストコード:
$client = new Zend_XmlRpc_Client('http://localhost/xmlrpc');
echo $client->call('customer.fetchCustomer', 1);
何か案は?