Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / WCF

Different tools to unit test your WCF services

4.67/5 (4 votes)
8 Jan 2011CPOL1 min read 69.5K  
Different tools to unit test your WCF services
A programmer's duty doesn't get over by just writing the code. It gets completed when you test each part of the program & make sure that the individual parts are correctly developed. I am adding some different tools details herewith which will help you to test your WCF services.

There is a tool that Microsoft ships with Visual Studio called WCF Test Client(WcfTestClient.exe) which can be found at the following location:

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\

More details on this can be found at:
http://msdn.microsoft.com/en-us/library/bb552364.aspx[^].

A limitation I found with this is, only Soap endpoints which can expose metadata about itself (WSDL or Mex) can be invoked using this. For WCF REST services, one alternative you can try is to create the test client yourself in code using the ChannelFactory<T> class using the same contract used in the service (you will have to manually write a proxy as svcutil.exe does not support automatic proxy generation for REST services). Then use some network capture tool such as Fiddler (www.fiddlertool.com) to send requests to the service.

Though not all WCF tools are free, here are a few which you can try out. I have tried out SOAP Ui & SOA Cleaner for my services & seems to be good.

SoapUI can be found at http://sourceforge.net/projects/soapui/files/[^].

SOA Cleaner can be found at:http://xyrow.com/Home/Free[^].

WCFStorm can be found at: http://www.wcfstorm.com/wcf/wcfstorm-lite.aspx[^].

One more useful way for developers to unit test WCF methods is to right click & generate test method. More details on this is available here:http://msdn.microsoft.com/en-us/library/ms182524(v=VS.90).aspx[^].

Hope you find this information useful. If you have come across any other ways to test WCF services, please share.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)