Click here to Skip to main content
15,886,067 members
Articles / WCF
Tip/Trick

Different tools to unit test your WCF services

Rate me:
Please Sign up or sign in to vote.
4.67/5 (4 votes)
8 Jan 2011CPOL1 min read 67.8K   13   5
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)


Written By
Software Developer (Senior) Dell
India India
I am a .Net developer working on C#,Asp.net,WCF,WF etc.I would like to utilize this space to share whatever I have come across so far working in .Net so that you can also learn & explore.

I hope you find these posts useful.I’d love to hear from you,so please post in your comments/feedback.

Visit my blog http://dotnetforyou.wordpress.com/ for more technical articles:

Comments and Discussions

 
GeneralSounds and looks good! :) Pin
Sandeep Mewara8-Jan-11 6:58
mveSandeep Mewara8-Jan-11 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.