为了账号安全,请及时绑定邮箱和手机立即绑定

SOAP错误:解析WSDL:无法从中加载-但可在WAMP上使用

SOAP错误:解析WSDL:无法从中加载-但可在WAMP上使用

PHP
HUWWW 2019-10-11 14:07:56
这在我的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);


查看完整回答
反对 回复 2019-10-11
  • 3 回答
  • 0 关注
  • 793 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信