Translate

Monday, August 8, 2011

How to use WCF test client

WCF test client is a user friendly tool that with which you can easily test a WCF service. It comes with Visual studio 2008 and above. It can be typically found at

 "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.exe".
OR
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.exe"

In this article I will show you how to use WCF test client. Consider that you are trying to test a local WCF service "http://localhost:8000/DilbertService" .(To see how to create a service, check out http://dotnetanalysis.blogspot.com/2011/08/introduction-to-wcf-windows.html). This service provides you with two methods, 
1>HelloWorld(): Which just says Hello World when invoked
2>Add(): Which adds two input numbers.


This is how you would test the service


1>Open the WCF test client


2>File->Add Service



3>Enter url of the service to be tested  "http://localhost:8000/DilbertService"



































4>Double click "Hello World"





5>Click on invoke to see the return value.

6>Similarly the "Add" function can also be tested.




No comments:

Post a Comment

Comments will appear once they have been approved by the moderator

Post a Comment