php-PHP soap Could not connect to host
function getResult()
{
$url = "http://bcsz.xms.foxhis.com:8080/ItfServerWS/XmsWS?wsdl";//正式地址
// $url = "http://xms.foxhis.com:922/ItfServerWS/XmsWS?wsdl";//测试地址
$postjson = '{"param":{"begin":"2015-12-17","end":"2015-12-18","rmtype":"","ratecode":""},"hotelid":"G000001","pwd":"foxhis","cmmcode":"WEB","user":"foxhis","rq":"rminfo"}';
try { $client = new SoapClient($url, array("trace" => true, "connection_timeout" => 100));
// var_dump($client->__getTypes());//列出所有的功能
logE('传入的json', $postjson);
$return = $client->getRoomAmount(array('arg0' => $postjson));//从接口地址获得的数据
logE('接收的值', $return);
$result = $return->return;
logE('返回的json', $result);
return $result;
} catch (SOAPFault $e) {
print_r('Exception:' . $e);
return null;
}
}
用测试接口就能返回数据,但是用正式接口总是Could not connect to host异常,各位大神怎么办?
上一篇: 通过grep 获取MySQL错误日志信息的方法代码示例
下一篇: PHP如何实现网页截图
推荐阅读
-
PHPMailer发送邮件,出现无法连接host (Could not connect to SMTP host)
-
发送邮件SMTP Error Could not connect to SMTP host. send fail的解决办法
-
php-PHP soap Could not connect to host
-
PHPMailer发送邮件,出现无法连接host (Could not connect to SMTP host)
-
BUG:Could not connect to Redis No route to host(redis集群报错)
-
发送邮件SMTP Error Could not connect to SMTP host. send fail的解决办法_PHP教程
-
SMTP Error: Could not connect to SMTP host
-
SMTP Error: Could not connect to SMTP host
-
发送邮件SMTP Error Could not connect to SMTP host. send fail的解决办法_PHP教程
-
PHPMailer发送邮件,出现无法连接host (Could not connect to SMTP host)