Creating a client to consume the WCF service
Now that we have successfully created and hosted a WCF service, we need a client to consume the service. We will create a C# client application to consume HelloWorldService
.
In this section, we will create a Windows console application to call the WCF service.
Creating the client application project
First, we need to create a console application project and add it to the solution. Follow these steps to create the console application:
In Solution Explorer, right-click on the solution,
HelloWorld
, and select Add | New Project… from the context menu. The Add New Project dialog window should appear, as shown below.Select Visual C# | Console Application as the template, change the project name from the defaulted value of ConsoleApplication1 to HelloWorldClient, and leave the Location as C:\SOAWithWCFandLINQ\Projects\HelloWorld. Click on the OK button. The new client project has now been created and added to the solution.