【问题标题】:Zend_XmlRpc :Failed to parse response errorZend_XmlRpc : 无法解析响应错误
【发布时间】: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


    【解决方案1】:

    你发送 xml 输出:

    echo $server->handle();
    

    【讨论】:

      猜你喜欢
      • 2023-03-20
      • 2019-03-16
      • 1970-01-01
      • 2015-07-01
      • 2020-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-19
      相关资源
      最近更新 更多