Consume a SOAP Service in an Azure function - soap

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?

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

Related

Why was SF Stateless Web API template removed?

In the picture below we can see in the year 2018 in VS2017 there is no Stateless Web API template in Service Fabric templates in VS. Why was this removed and what are it's replacements?
Because at the time you took the first screenshot, probably using .NET SDK 2.8 or earlier and SF tools for VS 1.7 and earlier, Service Fabric and the WebApi templates were based on dot net framework only.
The releases that came after Service Fabric .NET SDK 3.0 and SF tools for VS 2.0 , like the one in the screenshot, started a migration to .net standard 2, now you can target dot net framework or dot net core using the same libraries targeting .Net Standard. For A while you had both templates available, now everything is based on core.
The main difference between the old and the new is that the previous templates you used dot net framework 4.6.2 + Owin, now you use AspNet Core with any framework compatible with the .Net Standard 2.
You might get more info from these release notes:
https://blogs.msdn.microsoft.com/azureservicefabric/2017/09/25/service-fabric-6-0-release/
https://blogs.msdn.microsoft.com/azureservicefabric/2018/01/26/service-fabric-6-1-release/

AspNet Core Consuming WebService (VS2015)

In my AspNet Core project I need to consume a SOAP/WSDL WebService. I am using VS2015 and have made a non-aspnet core project to test the webservice (went fine), but with AspNet Core, I cannot seem to find a way to make this happen. It looks like SOAP webservice isn't supported (yet?) but if that is the case, is there a different way to consume a soap webservice?
I am already using the net461 framework so I can use the normal .NET libraries, but VS2015 doesn't expose the “Add Service Reference” menu option.
Find this similar question. I have not implemented/verified/tested it but hopefully yo can find some guidance. The sample is using the prior version of AspNet Core (AspNet 5)
ASP.NET 5 add WCF service reference
https://learn.microsoft.com/en-us/dotnet/core/additional-tools/wcf-web-service-reference-guide
See if this helps. In VS 2017, I am able to add the service reference from connected services in a .net core project. You might need to install "WCF Service Reference Provider" Extension.

How to make ASP.NET Core RC1 work with the GA SDK?

The previous non-GA versions of Service Fabric came with support (and template) for ASP.NET Core RC1. GA removed this support.
I have a project that depends on ASP.NET Core RC1. I would also like to update to the new SDK now.
I can get the asp.net service to run with the latest SDK without any significant changes to code. However creating a ActorProxy or ServiceProxy in the asp.net project fails with exception "The config package was not found". So my asp.net service is unable to communicate with the rest of the services in the application.
How can i fix the issue with ActorProxy and ServiceProxy on ASP.NET Core RC1 service?
Someone else discussed the same problem in the comments of Service Fabric documentation. Vaclav came up with workaround to the bug. Basically the client project requires ConfigurationPackage named "Config". Projects based on the old ASP.NET Core template didn't have the ConfigurationPackage.
For details of implementing the workaround, see:
https://azure.microsoft.com/en-us/documentation/articles/service-fabric-get-started/#comment-2601127160

Shared library for asp.net core app and windows service

I have an ASP.NET Core web app and a Windows Service that both access the same database. I am using Entity Framework Core as an ORM. I would like to be able to create a library package that encapsulates all data access (ie. a Repository) and can be shared by both the web app and the service.
Entity Framework Core appears to only be supported in DNX applications, and Windows Services, as standard Windows applications, cannot reference DNX projects. Is there any way of creating a DNX Windows Service, or another approach that would work?
Creating a standard windows class library with EF 6.x is not an option as the Repository has already been written in EF Core.
Just discovered my mistake, Entity Framework Core is supported in standard windows projects, so it looks like I have my solution: create a Repository class library that accesses the database using EF Core and reference it from both the ASP.NET Core and Windows Service apps.

BreezeJS and Entity Framework 6.0.1

I'm trying to create a Breeze Web API controller and I'm wondering if it is possible with the default MVC/Web API project template that comes with Visual Studio 2013. Updating everything through the Nuget packet manager installs Entity Framework 6.0.1. Attempting to installing Breeze after that results in an error as it attempts to install EF 5 as a dependency, which is not possible given the fact that other parts of the template depend on EF6.
Do we have to wait for a new version of Breeze that works with EF6?
Edit: I want to do this the "breeze way" using [BreezeController] and Odata.
I just wanted to add that even without EF6.1, the MVC 5 updates released today with VS2013 also break breeze. It's hard to separate the pieces to determine which new piece is responsible. It could be MVC or the new odata. In any case, we anxiously anticipate the new version.
Updated 10/29/13
As of now, Breeze 1.4.5 has support for Microsoft's ASP.NET WebApi 2 and Entity Framework 6. Please see http://www.breezejs.com/documentation/download.
Older post:
We don't yet support EF6 but it is coming ... soon...
There is a new package called Breeze.WebApi2 that is compatible with Web API2 and EntityFramework 6. It makes some of the existing Breeze packages obsolete. See http://www.breezejs.com/documentation/start-nuget for details.