【发布时间】:2010-05-13 04:45:04
【问题描述】:
我正在尝试让一个简单的 hello world XMLRPC 服务器设置正常工作。但是当我运行测试 URL 时,我得到了这个 Failed to parse response error 错误 http://localhost/client/index/ 在我的浏览器上
在我处理所有 XMLRPC 调用的 Rpc 控制器中
class RpcController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
}
public function xmlrpcAction()
{
$server = new Zend_XmlRpc_Server();
$server->setClass('Service_Rpctest','test');
$server->handle();
}
}
在调用 XMLRPC 服务器的客户端控制器中
class ClientController extends Zend_Controller_Action
{
public function indexAction()
{
$clientrpc = new Zend_XmlRpc_Client('http://localhost/rpc/xmlrpc/');
//Render Output to the view
$this->view->rpcvalue = $clientrpc->call('test.sayHello');
}
}
在我的 Service_Rpctest 函数中
<?php
class Service_Rpctest
{
/**
* Return the Hello String
*
* @return string
*/
public function sayHello()
{
$value = 'Hello';
return $value;
}
}
我错过了什么?
【问题讨论】:
标签: xml-rpc zend-xmlrpc