這在我的WAMP服務器上工作正常,但在linux主服務器上不起作用!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調用URL從PHP調用URL返回錯誤$wsdl = file_get_contents('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl');echo $wsdl;錯誤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命令行調用URL HTTP 200并返回XML響應curl http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
3 回答

喵喔喔
TA貢獻1735條經驗 獲得超5個贊
嘗試這個。希望對您有所幫助
$options = [
'cache_wsdl' => 0,
'trace' => 1,
'stream_context' => stream_context_create(
[
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
]
)
];
$client = new SoapClient($url, $options);
- 3 回答
- 0 關注
- 810 瀏覽
添加回答
舉報
0/150
提交
取消