LP on .NET

July 29, 2011

WCF Test Client

Filed under: C#,WCF — Larry Parker @ 3:14 pm

An invaluable tool I’ve been using quite a bit lately is the Windows Communication Foundation (WCF) Test Client.  You can find out more about it here on MSDN, but it’s basically a tool that acts as a service client by consuming an existing service and letting you interact with it through a nice user interface.

The program is named WcfTestClient.exe and can be found on your development machine in the following locations, depending on which version of Visual Studio you have installed:

Visual Studio 2008 C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
Visual Studio 2010 C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE

Here’s a screenshot of the WCF Test Client working with a service that performs temperature conversion:

image

Notice how the tool dynamically creates types based on the service’s WSDL, lets you enter values for the request message properties, and displays the response message properties after you call the service (by clicking the Invoke button).

The XML tab at the bottom of the screen can also be used to inspect the exact request and response SOAP messages:

image

This is especially useful for debugging your service calls (e.g. to ensure the expected message namespace is being used).

Hope this helps.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: