Step 1 - Create a WCF service application
- On the File menu, point to New and then click "Project".
- In the New Project dialog box, expand the Visual Basic or Visual C# node and click WCF, followed by WCF Service Application.
- Provide the project name, such as WCFService or another as you wish, and specify the location.
- Click OK to open the project.
The Solution Explorer will look like the following screen.
In the preceding Solution Explorer, you have seen three files I have highlighted in a blue box. They are -
IServices1.cs
We call it Contract in WCF. This file holds the interfaces that are declared under the Service contract and method signatures that are declared under the Operation contract in WCF.
Service1.svc
This is a class file where IServices1.cs interfaces are implemented. The whole logic is written here.
Web.Config
In a WCF application, Web.config files play another important role, as the application will have various sets of “ABC”- Address, Binding, and Contract and all those are defined in the web.config files.
Step 2 - Run the WCF application
Set the Service.SVC file as the “Start up page” and run the application. Now, the WCF Test client window will be displayed.
Step 5
Provide input parameters and click on the "Invoke" button for a response from the service.
Click on the method name, then follow the screenshot steps.