wcfmagentomagento-1.9wcf-bindingbasichttpbinding

basichttpbinding "SOAP-ERROR: Parsing WSDL: Couldn't load from" error [Magento 1.9.3.3]


I'm developing C# application for adding customer data to Magento server. When I try to send customer data, I got this error

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

This is my app.config contents:

<?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>

I wonder what wrong with it. Thanks.

UPDATE1: I changed my endpoint address from https://127.0.0.1/magento/index.php/api/v2_soap?wsdl=1 to https://127.0.0.1/magento/index.php/api/v2_soap/index like in Mladen Ilić's referred question. It still don't work and gave me this error:

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"

More info: my localhost uses self-signed SSL certificate but in my C# code, I already put these code below to bypass SSL check:

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

I think it might be something wrong with my app.config but I can provide my C# code if you interested. Thanks for advance.

UPDATE2: I changed the endpoint address to https://localhost.localdomain/magento/index.php/api/v2_soap/index so I don't need to use SSL bypass anymore. After hours of googling, I found using /api/v2_soap/index instead of api/v2_soap/index/?wsdl=1 is the right thing. My problem is I still got the same error as in UPDATE1.


Solution

  • My coworker and I already fix this issue. It caused by my test environment uses self-signed SSL.

    I posted more details at the answer of my coworker's question. Please follow this link below

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