"тнιѕ вℓσg ¢συℓ∂ ѕανє уσυя мσηєу ιƒ тιмє = мσηєу" - ∂.мαηנαℓу

Sunday 29 October 2017

Microsoft WCF Test Client OR How to Debug a Web Service Locally

Microsoft WCF (Windows Communication Foundation) test tool is a very useful GUI tool to test web services. Its a time saver if you would like to test the web service quickly. But more importantly if you have a locally deployed web service, you could debug locally using this tool. 

To debug locally, deploy (File deployment) your web service in your local IIS. Later add your local web service url ( For instance, https://localhost/mywssample.svc) in the WCF test tool. Then navigate to Visual studio and open the web service project. Debug tab->Attach process->tick the Choose processes from all users->Select w3wp.exe process->Click on Attach button-> place a break point wherever needed. When you invoke the service again, you would be able to debug locally.

The tool could be found in the following location

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE

For instance, lets say we have a web service sample to test. 

http://community.scribesoft.com/ScribeSample/ScribeSampleWebService.asmx?WSDL

Open the GUI from the Visual studio folder as shown below.


To add a new service, right click on the My Service Products and click on Add Service OR File->new service.

In the Add service window, enter the endpoint address as shown below.


Security warning pops up. Click ok if its a trustworthy service.


Once the service is added, you could see the methods as shown below.


Double click on the method and then click on the highlighted Invoke button.


Response section displays the data returned from the web service.

No comments:

Post a Comment