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

catspeake
TA貢獻(xiàn)1111條經(jīng)驗(yàn) 獲得超0個(gè)贊
嘗試這個(gè)。希望對您有所幫助
$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 關(guān)注
- 552 瀏覽
添加回答
舉報(bào)
0/150
提交
取消