1

Environment

Visual Studio 2017 Enterprise on MAC, Mono 5.12.0.309

Problem

I've successfully built and packaged an Azure Function. Now, I'd like to call a SOAP Web service in the function (over which I have no control). I added a Web Reference to the published WSDL and tried to compile the function which resulted in a ton of errors primarily indicating "System.Web.Services" namespace is missing.

"System.Web" doesn't seem to be part of .NET Core 2.1 (that is referenced in the function project). How would I then add a reference to "System.Web.Services" assembly? Is there a NuGet package?

UPDATE

Part of this was my lack of understanding of what .NET Core actually is. Since I'm using .NET Core, I can't make reference to assemblies that are targeting .NET Framework. "System.Web.Services" seems to be one.

Now the question becomes, how one would then call SOAP Services from .NET Core application?

Amir Keibi
  • 1,991
  • 28
  • 45
  • did you try with regular web requests? – Vladislav Oct 16 '18 at 14:06
  • @Vladislav I could have, but then I had to deal with a lot of things that an auto-generated proxy normally does (e.g.: writing a lot of boilerplate code). I did however find a way. Using the new "dotnet-svcutil" tool I can not only generate the proxy, request and response classes but also add all the required Nuget packages targeting .NET Standard at once. https://learn.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide – Amir Keibi Oct 16 '18 at 18:48

1 Answers1

1

You can use the new WCF client side stack on .NET Core: https://github.com/dotnet/wcf

There is a good sample to a question on this thread: Calling a SOAP service in .net Core

Sebastian Achatz
  • 668
  • 4
  • 14
  • That's more or less what I've done (as pointed out in my comment). Thanks. Although, I rather let "svcutil" generate the proxy classes and manage dependencies for me. That made my client side code more succinct compare to that example. – Amir Keibi Oct 24 '18 at 16:51