How you do SOAP in .NET Core? Are there any equivalents of Apache CXF in .Net Core (not just a simple SOAP client but full featured stack)?
Sorry if this is a very basic question, my search so far doesn't yield any clear answer.
How you do SOAP in .NET Core? Are there any equivalents of Apache CXF in .Net Core (not just a simple SOAP client but full featured stack)?
Sorry if this is a very basic question, my search so far doesn't yield any clear answer.
In VS 2017, as of December '17 (v15.5) you can now add a generated WCF client to a service using WSDL from a .NET Standard project using Connected Services. In the Solution Explorer, you can get there from a right-click on "Dependencies" or right-click on the project under "Add..."
Microsoft currently does not plan to ship a SOAP server side framework for .NET Core. Neither the WCF ServiceHost nor ASMX are available. Too early to tell, which of the non-Microsoft stacks will jump in and be the dominant player.
With the introduction of ASP.NET Web API and the uprising of REST endpoints, WCF was dead. The WCF client is a interop story, not a forward going story (full story here: http://blog.tonysneed.com/2016/01/06/wcf-is-dead-long-live-mvc-6/)
Some months ago, due to a limitation WCF clients have (when integrating with a Java Web Service, someone created a response class with the same name as the method and in the same namespace and when the WCF client was sending a request it failed the serialization - can't find the related question in SO) I had to create a SOAP HTTP client that used underline the HttpClient. I eventually released an open source version (https://github.com/gravity00/SimpleSOAPClient) that we are successfully using in production and supports .NET Core and Xamarin applications. Feel free to give it a try. I recommend version 2.0.0-RC03 due to some major improvements since version 1.x.
In VS 2017, as of December '17 (v15.5) you can now add a generated WCF client to a service using WSDL from a .NET Standard project using Connected Services. In the Solution Explorer, you can get there from a right-click on "Dependencies" or right-click on the project under "Add..."
Here u have a little trick I used targeting "framework 452" in an ASP.Net 5.0 Web App.
Unfortunately the new "Add connected service" -> "WCF service" only works when targeting ".Net Core", so I created a basic console app with same name as my web app.
Console apps allow to add "Service reference". Once added VS2015 creates all service references in folder "Service References".
Just move folder contents to Web solution and use a client constructor that accepts HttpBindings
and EndPoint
parameters.
In my case I'm connecting to Echosign service initializing client as follows:
using (EchoSignDocumentService16PortTypeClient service = new EchoSignDocumentService16PortTypeClient(new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress(adddress)))
{
...
}
I need SOAP for my legacy clients, so I created a separate SOAP library that is compatible with my legacy clients, using .NET framework, hosted in a separate environment. (SOAP.mywebsite.com). Then on www.mywebsite.com (created with asp.net Core, I have a rest interface. The SOAP layer calls the rest interface. The library to call the rest interface is generated using Swashbuckle.
To get around this problem....I created a nuget package in .Net 4.5 connecting to native SOAP clients not supported in .NET Core. Next I created a .Net core application targeting the .net framework. This allowed me to use the nuget package without errors.
© 2022 - 2024 — McMap. All rights reserved.