← All articles

A Very Cool WCF Tool: WCFTestClient.exe

WcfTestClient.exe, bundled with Visual Studio, lets you invoke and test any WCF service endpoint without writing a client or generating a proxy.

Donn Felker

Donn Felker

2009.04.10 · 2 min read

This an oldie, but a goodie. Not many people use this tool, much less know about it or where it exists.

By default when you install VS2008 (I’m not sure if its part of 2005 or not) you have a tool at your disposal in the Visual Studio install path:

My Path: c:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\

In this path, you’ll find a tool called “WcfTestClient.exe”

It is located here: c:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\WcfTestClient.exe

Fire this bad boy up and here’s the screen you get:

image

You can add a service endpoint by right clicking on “My Service Projects” and clicking Add Service

image 

Then paste in your service location (I’m using an open one I found on xmethods.net that generates prime numbers):

image

Click Ok, and the service contract, config, etc will be generated for you and you’ll have something that looks like this:

image

Double click on “GetPrimeNumbers” and you’ll see the following:

image

Open the body of the request (as it looks like this service uses message contracts) and where it says “(null)” select “GetPrimeNumbersRequestBody”

image

Then expand the body and the request what is the highest number the service should search for prime numbers (in english – give me all the prime numbers up to 50):

image

Click “Invoke”, wait a few seconds and your response will come back.

image

All Done!

You have now tested a WCF Service without creating an application, generating a proxy, running the app, etc. Super easy!

Other Uses

You could use this to test your own in house services or even to debug a service running on your machine during development (if you wanted to test full end to end). Simply paste in the address of your local service (http://localhost:someport/myservice.svc) and then start testing. This is a HUGE time saver to see if your service works or not. Otherwise you’d have to generate a client, perform a service reference or generate a service proxy, etc.

Donn Felker

Written by Donn Felker

I've spent 25+ years shipping software, writing books, and running my own companies. I write about thinking clearly, working for yourself, and doing real work while AI rewrites the rules. New essays land here every week.

Get the newsletter

Keep reading