How to access WCF Service in Asp.Net Core Application
From Logic Wiki
Installing WCF Connected Service Extension:
Below are the steps to install WCF Connected Service Extension in Asp.Net Core WebApplication
Right Click on the Connected Services Option
If the Extension is not installed then you will see the below window. User need to click on Find more Services link
Extension and Updates window will be displayed and from this window you can find the Visual Studio WCF Connected Service extension option
Click on Download button to install the extension. You may need to close the VisualStudio instances to complete the VSIX installation.
Accessing WCF Service in Asp.Net Core Web Application
In your Asp.Net Core web application, you will see a Connected Service Option like below
Follow the below steps to Add Service Reference
- Right Click on the Connected Services Option
- Select Add Connected Service and Add Connected Services wizard will be displayed and Select the WCF -Service Preview option
- Click on the Configure button. This will bring up Configure WCF Service Reference dialog box. Enter your Service url and Click on Go or Discover, it will discover the
- Click on Next and select appropriate options
- Click on Finish to generate proxy for WCF Service.
- Once after this you will be able to see Service Reference Folder added in our project.
- Now all you need to is to Create the Client and access the service like below
public async Task<IActionResult> Index()
{
//Creating Client object of Service Reference
SimpleServiceReference.SimpleServiceClient client = new SimpleServiceReference.SimpleServiceClient();
//Call the method from WCF Service
string result = await client.GetDataAsync(1);
return View();
}






