XMLRPC不断为CodeIgniter抛出500(Version MisMatch)

时间:2011-09-01 22:20:19

标签: php codeigniter soap xml-rpc

我一直致力于一个项目,该项目涉及连接到SOAP服务并从那里获取数据,而不是我可以直接访问的数据库。每当我转到此代码的页面时,我都会收到Did not receive a '200 OK' response from remote server. (HTTP/1.1 500 Internal Service Error)并在转到debug标志时看到

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:VersionMismatch</faultcode><faultstring>Wrong Version</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

这是我的SOAP客户端的代码。

class Game_model extends CI_Model {
    function __construct()
    {
            $this->key = 'someKeyYouCantKnow:)';
            // Call model construct
            parent::__construct();
    }

    function check_key()
    {
            $this->load->library('xmlrpc');
            $this->xmlrpc->server('http://some.url.I.cant/share/entry.php', 80);
            $this->xmlrpc->method('checkKey');
            $request = array(
                    array('apiKey' => $this->key)
                    // Have tried encaps`ing in another array and specifying 
                    // as a struct as well, or leaving out 'apiKey' all together
            );
            $this->xmlrpc->request($request);
            $this->xmlrpc->set_debug(TRUE);
            if(!$this->xmlrpc->send_request())
            {
                    return $this->xmlrpc->display_error();
            }
            else return $this->xmlrpc->display_response();
    }
}

0 个答案:

没有答案