Php調用WebService報錯

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://****/ReportService/WebService1.asmx' : Premature end of data in tag html line 3


暫時遇到了這條錯誤,

實際上是因爲 

$url = 'http://*****/ReportService/WebService1.asmx';
$client = new \SoapClient($url, array("trace" => 1, "exception" => 0));

這裏的url是 帶no-wsdl的

在url結尾加 ?wsdl即可

$url = 'http://****/ReportService/WebService1.asmx?wsdl';
$client = new \SoapClient($url, array("trace" => 1, "exception" => 0));

但是我這個報錯也是個別情況,百度良久沒答案於是試出來了

之後貼出請求webservice的方法

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章