SOAP in .NET Core?
Asked Answered
T

7

23

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.

Tadzhik answered 28/2, 2016 at 12:48 Comment(1)
WCF client side support is included, but there would be no server side.Crankcase
P
6

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..."

Pearse answered 20/2, 2018 at 19:57 Comment(0)
G
14

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/)

Grados answered 6/3, 2016 at 17:53 Comment(6)
This is kinda sad, since for some cases, SOAP is still superior for backend communication between services.Tadzhik
Sad it is. Nevertheless, for a NEW stack (which Core essentially is) it is the right decision. REST takes over as SOAP killed CORBA and RPC before. But a little bit support for existing environment and policies would have been nice.Grados
I read this many times. But WCF is not just SOAP! I can understand replacement of SOAP by the REST, but what about streams, named pipes, tcp, duplex etc.? REST will never catch these...Lylalyle
Agree. However, only 10% of usage. And in 2017 heterogeneous world, these do not fit either.Grados
Microsoft is asking for feedback on this: blogs.msdn.microsoft.com/whereismysolution/2017/09/08/…Selfsufficient
@Lylalyle look close to SignalR Core regards async messaging. They are brewing something there.Grados
M
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.

Masonite answered 19/8, 2016 at 17:40 Comment(3)
I've been looking for a working solution to not having access to consuming soap services and stumbled on your project, however the examples and tutorial don't seem to mesh with the library. Is this a v1.x vs 2.x issue?Rancher
Hi @Marqueone, I can try to help you with that. Feel free to open a GitHub issue with a code sample so I can give it a look.Cassiani
This is a good project. The only issue i had is that the svcutil generated classes i got have no XmlRoot attributes and so serialization with it doesn't work :(Mouth
P
6

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..."

Pearse answered 20/2, 2018 at 19:57 Comment(0)
M
1

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 EndPointparameters.

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)))
{
...
}
Mercier answered 5/11, 2016 at 1:50 Comment(2)
ServiceModel doesn't exist in .net core thoughDygert
"...only works when targeting '.Net Core'..." Should be noted that while searches are probably taking folks here, the OP was only asking about .NET Core.Pearse
K
1

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.

Krantz answered 24/4, 2017 at 8:39 Comment(0)
B
0

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.

Burbank answered 7/8, 2017 at 7:12 Comment(0)
V
0

This is now possible now via CoreWCF. See:

Accouncement

GitHub Repo

Vlissingen answered 15/5 at 13:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.