我正在使用rpc库与客户端和服务器进行通信,以下是我的代码。
<?php
class ClientController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
echo "Hello you are in index";
$client = new Zend_XmlRpc_Client('Server url');
//var_dump($client);
try {
echo "cf doesent called";
$data = $client->call('cf.test');
$this->view->data = $data;
} catch (Zend_XmlRpc_Client_HttpException $e) {
require_once 'Zend/Exception.php';
throw new Zend_Exception($e);
} catch (Zend_XmlRpc_Client_FaultException $e) {
require_once 'Zend/Exception.php';
throw new Zend_Exception($e);
}
}
}
class ServerController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
$this->_helper->viewRenderer->setNoRender();
$server = new Zend_XmlRpc_Server();
$server->setClass('Application_Model_Data', 'cf');
echo $server->handle();
}
}
<?php
class Application_Model_Data
{
/**
* Test method
*
* @return string
*/
public function test()
{
return 'Hello XMLRPC!';
}
}
但是当我尝试运行时,它给了我错误“”NetworkError:500内部服务器错误 - 网址“任何帮助..