这在我的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();
}
Run Code Online (Sandbox Code Playgroud)
我在这里想念的是什么?!:(
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"
Run Code Online (Sandbox Code Playgroud)
从PHP调用URL会返回错误
$wsdl = file_get_contents('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl');
echo $wsdl;
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
从HTTP 200XML 命令行调用URL将返回XML响应
curl http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
Run Code Online (Sandbox Code Playgroud)