首页 > 解决方案 > SOAP-ERROR:解析 WSDL:无法从 'HTTPS 加载 不使用 https

问题描述

我必须使用SOAP将日期转移到我们的ERP系统中。问题是当我使用http wsdl一切正常但如果我将链接更改为https然后我有一个错误: SOAP-ERROR: Parsing WSDL: Couldn't load from 'HTTPS... 我真的不明白这一点,因为在网络服务器上我可以绑定两个地址httphttps. 而且我可以在网络浏览器中打开,没有任何问题。我需要在我的代码中添加一些额外的东西来允许https吗?

我目前的要求(标准):

     $UserID = 'domain\username';
        $Pwd = "password";
        $ns = 'HTTP://URL/file.svc?wsdl';

        if (!defined('USERPWD')){define('USERPWD', $UserID.':'.$Pwd);};

// we unregister the current HTTP wrapper
        stream_wrapper_unregister('http');
// we register the new HTTP wrapper
        stream_wrapper_register('http', 'NTLMStream') or die("Failed to register protocol");


        $options['trace'] = 1;
        $options['soap_version'] = SOAP_1_1;
        $options['compression']  = SOAP_COMPRESSION_ACCEPT;

        try
        {

// Initialize Soap Client
           $client = new NTLMSoapClient($ns,$options);
            $client->setUSERPWD(USERPWD);

这是工作时的示例,但是一旦我将 url 更改为https然后一切都会停止。

标签: phpxmlsoap

解决方案


推荐阅读