SOAP错误:无法加载外部实体

时间:2019-03-10 09:14:19

标签: php magento soap

我正在使用汤和以下代码:

try{
    $opts = array(
        'http' => array(
            'user_agent' => 'PHPSoapClient'
        )
    );
    $context = stream_context_create($opts);
    $wsdlUrl = 'https://someurl.com/index.php/api/v2_soap?wsdl';

    $soapClientOptions = array(
        'stream_context' => $context,
        'cache_wsdl' => WSDL_CACHE_NONE,
    );

    $soapClient = new SoapClient($wsdlUrl, $soapClientOptions);
    $sessionId = $soapClient->login('test', 'pass123'); 

    print_r($sessionId);exit;


}
catch(SoapFault $ex){
    print_r($ex->getMessage());
}
catch(Exception $ex) {
    print_r($ex->getMessage());
}

我的汤客户反应非常好。但是,当我尝试登录时会出现错误。

错误是:

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://someurl.com/index.php/api/v2_soap?wsdl=1' : failed to load external entity "https://someurl.com/index.php/api/v2_soap?wsdl=1"

NB PHP版本是7.0&magento 1.9.4.0

寻找解决方案。

0 个答案:

没有答案