php-PHP soap Could not connect to host

WBOY
Release: 2016-06-02 11:29:07
Original
1937 people have browsed it

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));
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!