Awin API中的致命错误 - 未捕获的SoapFault异常:[WSDL] SOAP-ERROR:解析WSDL:无法从

时间:2017-10-28 12:45:16

标签: php api magento

我有一个非常严重的问题。我正在使用API​​ - https://ui.awin.com/awin/affiliate/250615?region=gb,登录后,我找到了api文档和php api客户端zip。

然后我下载了这个客户端zip,更新了我所有的api详细信息,当我运行 - http://202.131.107.107/searchcycle/ps_client.php时,我总是得到如下错误 -

  

致命错误:未捕获的SoapFault异常:[WSDL] SOAP-ERROR:解析WSDL:无法从' http://v6.core.com.productserve.com/ProductServeService.wsdl'加载:未能加载外部实体" http://v6.core.com.productserve.com/ProductServeService.wsdl"在/var/www/html/searchcycle/classes/class.php5Client.php:57堆栈跟踪:#0 /var/www/html/searchcycle/classes/class.php5Client.php(57):SoapClient-> SoapClient( ' http://v6.core ....',数组)#1 /var/www/html/searchcycle/classes/class.php5Client.php(95):Php5Client-> __ construct(Object( stdClass))#2 /var/www/html/searchcycle/classes/class.ClientFactory.php(60):Php5Client :: getInstance(Object(stdClass))#3 /var/www/html/searchcycle/ps_client.php( 29):在第57行的/var/www/html/searchcycle/classes/class.php5Client.php中抛出ClientFactory :: getClient()#4 {main}

有人可以帮助我解决这方面的问题。

1 个答案:

答案 0 :(得分:0)

添加可选的SSL参数。

如何解决:

// options for ssl in php 5.6.5
$opts = array(
    'ssl' => array(
        'ciphers' => 'RC4-SHA',
        'verify_peer' => false,
        'verify_peer_name' => false
    )
);

// SOAP 1.2 client
$params = array(
    'encoding' => 'UTF-8',
    'verifypeer' => false,
    'verifyhost' => false,
    'soap_version' => SOAP_1_2,
    'trace' => 1,
    'exceptions' => 1,
    'connection_timeout' => 180,
    'stream_context' => stream_context_create($opts) // Magic happens here
);

$wsdlUrl = $url . '?WSDL';
$oSoapClient = new SoapClient($wsdlUrl, $params);

请检查question,你会发现一些有用的东西。