WCF Services
Connecting to WCF Services Services using Visual Studio or the SVCUtil CLI
Updated: 03 September 2023
In order to consume a WCF Service from a .NET client you can make use of the Connected Services
section in Visual Studio, or using the svcutil
tool in the dotnet cli
SVCUtil
You first need to install the svcutil
with:
To create a new service reference you can run the following command with your service endpoint
Which will create a ServiceReference.cs
file which contains your service references
Visual Studio
From the Connected Services
item under the relevant project in the Visual Studio Solution Explorer, double click on Connected Services and then Microsoft WCF Web Service Reference Provider
and input your URL and click Go
Thereafter the available services will be listed and you can set the service namespace and click Finish
Usage
In your .cs
file that you want to use the service do the following:
In order to use the service you need to create an instance of the Service and then just call the required operation