Magento - 通过https访问SOAP api时出现问题

SOAP API is not working on https.

After enabling https on my site, I am getting SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://example.com/index.php/api/soap/index/?wsdl=1' failed to load external entity "https://example.com/index.php/api/soap/index/?wsdl=1"

I have tried even on fresh Magento version 1.7 and 1.9 but both of them giving the same issue.

This is the sample code that I am using, it is working fine with HTTP URL but it is giving issue with https:

`try {
    $cli = new SoapClient('https://www.example.com/index.php/api/soap/index/?wsdl=1', ["trace" => 1,"exceptions" => true,]);
    $session = $cli->login('test_test', test12345');
    $result = $cli->call($session, 'sales_order.info', 100026xxx);

    echo '<pre>';print_r($result);
    $cli->endSession($session);

} catch(Exception $e) {
    echo '<pre>';
    print_r($e);
}

This is the actual error that I am facing SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://example.com/index.php/api/soap/index/?wsdl=1' failed to load external entity "http://example.com/index.php/api/soap/index/?wsdl=1"

dsu89430
dsu89430 当我在浏览器中访问APIURL(https/http)时,会出现同样的错误
5 个月之前 回复
dongyuan9292
dongyuan9292 您的网站是否使用https运行?只是想确认一下。主要是使用http或https对api没有任何限制。某些情况下,网站可能无法使用SSL运行。在浏览器中尝试apiurl,看看发生了什么。
5 个月之前 回复
dongyili5843
dongyili5843 谢谢...添加了细节,你对这类问题有任何想法。
5 个月之前 回复
drwxg62286
drwxg62286 当然,你意识到Magento1已经过时并且明年将失去所有支持?
5 个月之前 回复
dongmeiba6151
dongmeiba6151 请不要在评论部分添加代码,而是编辑您的问题以包含所有相关信息。另外,你试图调试什么问题?
5 个月之前 回复
dongyuan6949
dongyuan6949 你能分享一些代码或其他细节吗?当前URL甚至没有列出WSDL文件
5 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问