XMLRPC постоянно выбрасывает 500 (в частности, версию MisMatch) для CodeIgniter - PullRequest
1 голос
/ 02 сентября 2011

Я работал над проектом, касающимся подключения к службе 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();
    }
}
...