相关疑难解决方法(0)

SOAP-ERROR:解析WSDL:无法加载 - 但适用于WAMP

这在我的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

从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)

从命令行调用URL

HTTP 200XML 命令行调用URL将返回XML响应

curl http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
Run Code Online (Sandbox Code Playgroud)

php soap

51
推荐指数
4
解决办法
18万
查看次数

标签 统计

php ×1

soap ×1