无法加载外部实体" https://ws.hipay.com/soap/payment-v2?wsdl"

时间:2018-06-14 09:58:21

标签: laravel web-services soap wsdl

我使用hipay帐户并使用webservices集成到我的网站laravel。

我在其他项目中使用了相同的代码共享,它的工作正常,但现在在其他项目中它在文件Saop的开头生成错误

的SOAPFault SOAP-ERROR:解析WSDL:无法从' https://ws.hipay.com/soap/payment-v2?wsdl'加载:未能加载外部实体" https://ws.hipay.com/soap/payment-v2?wsdl"

并且有我的代码

    `$options = array(
    'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'soap_version' => SOAP_1_1,
    'encoding' => 'UTF-8'
    );

    $client = new SoapClient('https://ws.hipay.com/soap/payment-v2?wsdl', 
    $options);`

我使用OVH托管,谢谢

1 个答案:

答案 0 :(得分:0)

测试此代码:

<?php

$opts = array(
'http' => array(
    'user_agent' => 'PHPSoapClient'
)
);
$context = stream_context_create($opts);
$options = [
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
'cache_wsdl' => WSDL_CACHE_NONE,
'soap_version' => SOAP_1_1,
'encoding' => 'UTF-8',
'stream_context' => $context,
];

$client = new SoapClient('https://ws.hipay.com/soap/payment-v2?wsdl',$options);