BIZUAYEHU
BIZUAYEHU

Reputation: 41

Consume soap web service in asp.net core

I am working on asp.net core i want to consume soap web service in my project in previous i can consume soap web service using asp.net mvc, but how to consume it in ASP.NET core,if you have an idea or an example. Regards,

Upvotes: 4

Views: 17690

Answers (1)

TheHvidsten
TheHvidsten

Reputation: 4418

Assuming you are using Visual Studio, you can right-click your project in "Solution Explorer" and choose Add -> Connected Service. In the new window that appears you choose Microsoft WCF Web Service Reference Provider.

This will open a popup where you can type an URL to the WSDL definitition of the SOAP web service. Click "Go" to fetch the WSDL from the URL, or click "Browse" to use a local WSDL file.

You should now see the SOAP service in the "Services" area. Give your service a proper namespace and click "Finish" (there are other options, but you can leave them on their default settings).

Visual Studio will now generate some files and classes. One of these classes is named ...Client. Make a new instance of this class and you should find that it contains all the methods the SOAP service provides. Call these methods (with the appropriate parameters) and you will invoke the service.

Source: https://learn.microsoft.com/en-us/dotnet/core/additional-tools/wcf-web-service-reference-guide

Upvotes: 7

Related Questions