Zend_XmlRpc参数问题
我试图获得一个简单的客户端/服务器 XMLRPC 服务器设置,但在使用参数时遇到问题。如果我从 fetchClient() 方法和 $client->call() 中取出 $client_id 参数,代码运行正常。但是,如果我包含它,服务器将返回“调用参数与签名不匹配”
控制器代码:
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);
有什么想法吗?
I'm trying to get a simple client/server XMLRPC server setup but I am having trouble using parameters. The code runs fine if I take the $client_id parameter out of the fetchClient() method and $client->call(). However if I include it, the server returns "Calling parameters do not match signature"
Controller Code:
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 Testing Code:
$client = new Zend_XmlRpc_Client('http://localhost/xmlrpc');
echo $client->call('customer.fetchCustomer', 1);
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
漠视。我找到了正确的输入参数:
Disregard. I figured out the correct parameter to input: