【问题标题】:basichttpbinding "SOAP-ERROR: Parsing WSDL: Couldn't load from" error [Magento 1.9.3.3]basichttpbinding“SOAP-ERROR:解析 WSDL:无法加载”错误 [Magento 1.9.3.3]
【发布时间】:2018-08-27 17:17:44
【问题描述】:

我正在开发用于将客户数据添加到 Magento 服务器的 C# 应用程序。当我尝试发送客户数据时,我收到了这个错误

System.ServiceModel.CommunicationException: 'Unrecognized message version.'

这是我的app.config 内容:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="httpBinding" maxReceivedMessageSize="2147483647">
              <security mode="Transport">
                <transport clientCredentialType="None"></transport>
              </security>   
            </binding>
         </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://127.0.0.1/magento/index.php/api/v2_soap?wsdl=1"
                binding="basicHttpBinding" bindingConfiguration="httpBinding"
                contract="MagentoService.PortType" name="Port"/>
        </client>
    </system.serviceModel>
</configuration>

我想知道它有什么问题。谢谢。

更新 1: 我将端点地址从 https://127.0.0.1/magento/index.php/api/v2_soap?wsdl=1 更改为 https://127.0.0.1/magento/index.php/api/v2_soap/index,就像 Mladen Ilić 提到的问题一样。它仍然不起作用并给了我这个错误:

System.ServiceModel.FaultException: 'SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://127.0.0.1/magento/index.php/api/v2_soap/index/?wsdl=1' : failed to load external entity "https://127.0.0.1/magento/index.php/api/v2_soap/index/?wsdl=1"

更多信息:我的本地主机使用自签名 SSL 证书,但在我的 C# 代码中,我已经将这些代码放在下面以绕过 SSL 检查:

System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

我认为我的app.config 可能有问题,但如果您有兴趣,我可以提供我的 C# 代码。感谢您的提前。

UPDATE2:我将端点地址更改为https://localhost.localdomain/magento/index.php/api/v2_soap/index,因此我不再需要使用 SSL 绕过。经过数小时的谷歌搜索,我发现使用 /api/v2_soap/index 而不是 api/v2_soap/index/?wsdl=1 是正确的。我的问题是我仍然遇到与 UPDATE1 中相同的错误。

【问题讨论】:

标签: wcf magento magento-1.9 wcf-binding basichttpbinding


【解决方案1】:

我和我的同事已经解决了这个问题。由于我的测试环境使用自签名 SSL 造成的。

我在回答同事的问题时发布了更多详细信息。请点击以下链接

C# How do I add customer data using SOAP V2 in HTTPS (Magento 1.9.3.3)

【讨论】:

    猜你喜欢
    • 2011-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-04
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    相关资源
    最近更新 更多