SOAP 错误:解析 WSDL:无法从 加载 - 但在 WAMP 上工作错误从 PHP 调用 URL错误从命令行调用 URL编辑
这在我的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 将返回 XML 响应HTTP 200
curl http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl