XMLRPC 不断为 CodeIgniter 抛出 500(特别是版本不匹配)
我一直在从事一个项目,该项目涉及连接到 SOAP 服务并从那里获取数据,而不是我可以直接访问的数据库。每当我访问此代码的页面时,我都会收到没有收到来自远程服务器的“200 OK”响应。 (HTTP/1.1 500 内部服务错误)
并在打开 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();
}
}
I've been working on a project that concerns connecting to a SOAP service and grab data from there rather than a DB I have direct access with. Whenever I go to the page for this code I receive Did not receive a '200 OK' response from remote server. (HTTP/1.1 500 Internal Service Error)
and upon turning debug
flag on I see
<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>
Here's the code for my SOAP client.
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();
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论