質問

いることができるよう簡単なクライアント/サーバー XMLRPCサーバの設定をしたいが困用パラメータ。このコードを走る微細なった場合には、 $client_id パラメータの fetchClient() 方法 $client->コ().しかし場合を含みますので、サーバを返します"呼び出しパラメータが一致しない署名"

コントローラーコード:

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);

そのアイデア?

役に立ちましたか?

解決

は無視してください。私は入力に正しいパラメータを考え出します:

echo $client->call('customer.fetchCustomer', array(array('client_id' => 1)));
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top