- IService – Service Interface File
- Service.SVC – It’s the file where Service code is available and similar to .asmx file of web service
- Web.config – Configuration details where the Endpoint information are stored.
This is the file which has all the declaration and not definition if properties, here we call it as Contract in WCF and this helps for all the operations that happens with the service so named as “Operation Contract”.
Data ContractHere the Data are to be transferred and processed with in service and they store the values, so in the WCF terminology they are called as “Data Contract”.
Service.SVCThis is the main file for any of the WCF service where this file inherits the “IService” interface and implements all the method of the operation contract methods. Now, you can find two methods are implemented in the .SVC file.
Web.ConfigIn a WCF application Web.config files plays another important role, as the application will have various set of “ABC”- Address, Binding and Contract and all those are defined in the web.config files.
Sample Config Entries
Execute the Application using WCF Test Client:The WCF Test Client is one of the best tools for the developers to test the WCF application. Windows Communication Foundation (WCF) Test Client (WcfTestClient.exe) is a GUI tool that enables users to input test parameters, submit that input to the service, and view the response that the service sends back. It provides a seamless service testing experience when combined with WCF Service Host.
This file will be available in following location,C:\Program Files (x86)\Microsoft Visual Studio (Your Version Here)\Common7\IDE
Step 3:Set the Service.SVC file as the “Start up page” and execute the application, so automatically the WCF Test client window will be displayed.
WCF Test Client Execution:Here all the Methods will be displayed and also the appropriate method details will be displayed on the right side pane when you select the methods, which are readily testable.