PHP头条
热点:

php-PHPsoapCouldnotconnecttohost


soapphp

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异常,各位大神怎么办?

www.phpzy.comtrue/php/2504.htmlTechArticlephp-PHPsoapCouldnotconnecttohost soapphp function getResult() { $url = "http://bcsz.xms.foxhis.com:8080/ItfServerWS/XmsWS?wsdl";//正式地址 // $url = "http://xms.foxhis.com:922/ItfServerWS/XmsWS?wsdl";//测试地址 $postjson = '{"param"...

相关文章

相关频道:

PHP之友评论

今天推荐