Debugging wcf service

When you press on F5 Windows Communication Foundation Service Host (WcfSvcHost.exe) allows you to launch the Visual Studio debugger to automatically host and test a service you have implemented. Then you can test the service using WCF Test Client (WcfTestClient.exe)

If the WCF Test Client was not opened when you press on F5, and if it opens the service URL then to debug the service by using WCF Test Client follow the below steps.

1. Run WCF Service and copy the URL.

2. Run Visual Studio Command Prompt as Administrator and type WcfTestClient.exe and click enter.

visual studio command prompt

3. WCF Test Client will be opened.

wcf test client

4. Click on File Menu and select Add Service, paste the URL and click OK.

add service

5. WCF Service will be added to WCF Test Client, Expand the service and double click on the Service Method and give values if any parameters defined to the methodand click on Invoke. (Put a break point in Service method).

invoke wcf service

6. Break point will be fired.

break point

7. After execution Formatted & XML output will be displayed in WCF Test Client.

output of wcf service