skip to Main Content

I am currently trying to connect my ASP-NET Core 2 application to Magento’s API (WSDL v2), but keep receiving the following errors:
*Doesn’t matter which method I call, even the new PortTypeClient().loginAsync(username, password); throws that, with this random endpoint name salesOrderShipmentAddComment.

InvalidOperationException: The operation
‘salesOrderShipmentAddComment’ could not be loaded because it
specifies “rpc-style” in “literal” mode, but uses message contract
types or the System.ServiceModel.Channels.Message. This combination is
disallowed — specify a different value for style or use parameters
other than message contract types or
System.ServiceModel.Channels.Message.

However, using SoapUI, postman or importing with framework 4.6, it works perfectly.
Using the Magento v1 API it works too, but I don’t want to use this version.

During the import in asp-net core, I also recieve those warnings (importing v1 doesn’t shows any warning):
enter image description here

I’m almost creating a new 4.6 application, hosting it separately to work as a bridge between my application and Magento, even if it hurts my performance and architeture.

This is how I’m doing the import:
enter image description here
*Obs: In Data Type Options, I also tried checking different options, and selecting other data types.

Anything would help…
Thanks in advance

4

Answers


  1. I had the same problem. Make sure you update your Nuget Packages to 4.5.3. After, works correctly for me.

    Login or Signup to reply.
  2. Indeed updating the following packages to version 4.5.3 seems to resolve the issue:

    System.ServiceModel.Duplex

    System.ServiceModel.Http

    System.ServiceModel.NetTcp

    System.ServiceModel.Security

    Seems like 4.4.4 version of those packages are installed by default, while adding WCF service reference via VS 2017 15.9.4 UI

    Login or Signup to reply.
  3. Just update System.ServiceModel.Http to 4.5.3

    Login or Signup to reply.
  4. According to
    https://ozguradem.net/english/coding/2018/11/06/soap-services-with-dotnet-core/

    Open .csproj file and edit following packages minimum version like these

     <ItemGroup>
           <PackageReference Include="System.ServiceModel.Duplex" Version="4.5.*" />
           <PackageReference Include="System.ServiceModel.Http" Version="4.5.*" />
           <PackageReference Include="System.ServiceModel.NetTcp" Version="4.5.*" />
           <PackageReference Include="System.ServiceModel.Security" Version="4.5.*" />
       </ItemGroup>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search