Last post Jul 08, 2016 10:45 AM by Alex Griciuc
Jul 06, 2016 09:33 PM|ihcdev|LINK
We are starting a new application and I have been kicking the tires on ASP.NET 5 trying to get used to all of the new features. So far everything looks really good, but I have encountered a road block that I cannot seem to get beyond. I never dreamed this
would be that difficult. The web application we are going to develop is new but most of the back end services are not. They are old SOAP services created with WCF. As everyone knows, in the past this was as simple as having the url to the service and clicking "Add
Service Reference" and you're done. I am not really surprised that this has changed, but I didn't think support for this situation wouldn't be there. In any case, I cannot seem to figure this out.
I have seen a few old posts about this subject, but none of them have helped. I also saw a promising tool called "WCF Connected Service Visual Studio Extension Preview for ASP.NET 5 Projects", but it wouldn't install for me in Visual Studio 2015 Update 3.
Ultimately, our app will be hosted in IIS and have access to the full .net framework if that makes a difference. It would be a shame if I couldn't use these great new features because this is either not possible or too time consuming to implement by hand.
Jul 07, 2016 07:21 AM|mithunvp|LINK
From your question I can understand that
1. You have SOAP based WCF service, which you want to consume in ASP.NET Core, right?
2. WCF connected services at present doesn't work with VS 2015 Update 3.
3. Also you are hosting on IIS and full .NET framework access present.
Based on these scenario's i will suggest following to use existing WCF service
"Create .NET class library, add service reference of existing WCF service, through class library expose methods of WCF service (kind of wrapper). Publish class library as NUGET package (need not upload on global nuget) and then add this Nuget reference in
core project.json file. It will restore the NUGET package (class library expose WCF client)."
In this way it would be feasible for you to consume WCF service. Little overhead of creating class library is present.
Jul 08, 2016 10:45 AM|Alex Griciuc|LINK
Yes, the WCF connected service VS extension is the correct way to go. I've installed it and it works fine on my VS 2015 Update 3 Enterprise edition. You can get the latest version of it from here: https://visualstudiogallery.msdn.microsoft.com/c3b3666e-a928-4136-9346-22e30c949c08
In lieu of the extension, you could also use svcutil.exe. Shayne Boyer has an excellent article covering just that: http://tattoocoder.com/asp-net-core-getting-clean-with-soap/. He
also has a video on Channel 9 using the WCF connected service with .net core, but I can't find it now :)
This SO answer here also covers how to setup the data contracts and serialization when workig with wcf services from .net core: http://stackoverflow.com/questions/37392032/net-core-rc2-consuming-external-wcf