Tuesday, September 4, 2012

Test & Debug WCF service using WCFTestClient.exe

VS.NET 2010 provides WCFTestClient.exe for us to test and debug the WCF service. 
Please follow me to test and debug the service.
Generally, first debug and then test the service, but here first I will tell you how to test it and then how to debug it J

Test the WCF service using WCFTestClient.
1.       Open “Visual Studio Command Prompt (2010)”
2.       Go to “c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\”
3.       Run WcfTestClient.exe
4.       It will open WCF Test Client, now add WCF Service (URL)
5.       Select the service method, from left panel
6.       Provide request data (i.e. values to parameters) on right panel and click on Invoke button. It gives you the response.

Debug the WCF service, follow the commands.
1.       Go to WCF service project properties
2.       Go to Web menu on left menu
3.       Select WcfTestClient.exe from “c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\” for “Start external program”
4.       Provide service in command line arguments, for which the service to be debug.
5.       Place break points on the service source code
6.       Set WCF project as “Startup Project” from properties
7.       Run the project (F5).
8.       Now it will build the project(s), and start debugging the WCF service.

1 comment:

Rahul Nikate said...

Thanks buddy. It helped me.