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

时间:2019-08-12 12:15:41

标签: php web-services magento soap https

SOAP API不适用于https。

在我的网站上启用https后,我收到SOAP错误:解析WSDL:无法从'https://example.com/index.php/api/soap/index/?wsdl=1'加载未能加载外部实体“ https://example.com/index.php/api/soap/index/?wsdl=1

我什至尝试了新的Magento 1.7和1.9版本,但它们都给出了相同的问题。

这是我正在使用的示例代码,可以与HTTP URL正常工作,但是与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);
}

这是我面临的实际错误 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"

0 个答案:

没有答案
相关问题