我正在尝试使用网络服务。我有我的开发环境(笔记本电脑)在Windows上,还有一个在Fedora上的测试环境(服务器)。 两者共享相同的互联网连接以及我正在测试的应用程序的相同源代码。
当前的问题
任何人都可以告诉我发生了什么以及如何解决这个问题?无论是网络问题还是源代码?
以下是我的源代码:
function execute_curl($variables) //removed variables because its too long
{
$this->CI->load->model('mws_transmit_model');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml','SOAPAction:"'.$http_header.'"'));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $string);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PORT, 443);
if(isset($ssl_version)):
{
curl_setopt($ch, CURLOPT_SSLVERSION, $ssl_version);
}
endif;
if(isset($ca_info)):
{
//curl_setopt($ch, CURLOPT_CAINFO, $ca_info);
}
endif;
if(isset($ssl_cert)):
{
//curl_setopt($ch, CURLOPT_SSLCERT, $ssl_cert);
}
endif;
if(isset($ssl_cert_pass)):
{
//curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $ssl_cert_pass);
}
endif;
if(isset($time_out)):
{
if($time_out !== "0"):
{
curl_setopt($ch, CURLOPT_TIMEOUT, $time_out);
}
endif;
}
endif;
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$ch_result = curl_exec($ch);
if(curl_errno($ch) == "0"):
{
//RETURN SUCCESSFUL CONSUMPTION OF WEB SERVICE
}
else:
{
//RETURN ERROR
}
endif;
}