這對我的WAMP服務器正常工作,但不能在Linux主服務器上工作!?SOAP-ERROR:解析WSDL:無法從 - 加載WAMP
try{
$client = new SoapClient('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl', ['trace' => true]);
$result = $client->checkVat([
'countryCode' => 'DK',
'vatNumber' => '47458714'
]);
print_r($result);
}
catch(Exception $e){
echo $e->getMessage();
}
我在這裏錯過了什麼? :(
SOAP啓用
錯誤
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl' : failed to load external entity "http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"/taxation_customs/vies/checkVatService.wsdl"
呼叫從PHP
從PHP調用的URL將返回錯誤
$wsdl = file_get_contents('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl');
echo $wsdl;
錯誤的URL
Warning: file_get_contents(http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl): failed to open stream: HTTP request failed! HTTP/1.0 503 Service Unavailable
調用命令行
的URL調用從Linux命令行HTTP 200
的URL返回一個XML響應
curl http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
什麼'捲曲的http:// ec.europa.eu/taxation_customs /搶答/如果你在Linux服務器上的shell中運行它checkVatService.wsdl'說? – ntaso
HTTP 200和XML是響應 – clarkk
聽起來像它可能是一個字符編碼問題。 SOAP客戶端期望的字符集中是否編碼了WDSL? – GordonM