Using the WCFTestClient Tool to Test Service Operations


Hello

In case you didn't know, Visual Studio ships a handy tool called WCFTestClient.exe that you should try. It's a great tool for discovering and testing WSDL operations without writing any code. You can view the request and response messages in a formatted view or in XML. For details, see WCF Test Client (WcfTestClient.exe). There is one catch… it is available only with Visual Studio 2008 SP1.

If you use the default Visual Studio install folder, you can find the tool in the C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ folder.

clip_image001

After starting the WCF Test Client tool, click File->Add Service, and enter the endpoint address of the service you want to open. For a list of adCenter sandbox addresses, see Microsoft adCenter Web Services Addresses (when you play with this tool, make sure that you use the sandbox addresses and not the production addresses).

The left pane of the WCF Test Client main window lists all the available services, along with their respective endpoints and operations.

When you double-click on an operation in the left pane, the operation is opened in the right pane. The operation's tab shows the request and response properties in either a Formatted or XML view. When you click Formatted, you can enter arbitrary values for the properties to test the service. To send the request to the service, click Invoke.

There is one trick that is not documented or obvious when working with arrays. To specify an array in your request, enter length=n in the Value column, where n is the number of elements that you want in the array. You can then expand the list (click the + sign) to add the values of the array elements.

The following snippets show the progression.

image

image

image

 

 

image

image

 

Thanks and enjoy!

Comments (13)

  1. Cnorred says:

    Thanks, I needed this information today!

  2. Cnorred says:

    Hi ,

    Can anyone tell me as how to paste an xml file from an external file ?

  3. Cnorred says:

    Tnx for the array parameter trick

  4. Cnorred says:

    Thanks a lot.

  5. Anonymous says:

    Thanks so much for this info! I always had to set up a client programmatically  in order to be able to test my service.

    Thanks again

  6. Anonymous says:

    This was exactly what I needed, thank you for posting this.

  7. Anonymous says:

    Such a coicidence, i am from the same team as you and reached here from Bing. Thanks for the array tip.

  8. Anonymous says:

    Thank you, Appreciate your great help. Saved tons of time. This is what i exactly looking for. It is easy, but tricky.

  9. Anonymous says:

    Thank you very much for the tip

  10. Anonymous says:

    Not user friendly Tool. Found finally some answer for this tricky issue. Thanks Again.

  11. Anonymous says:

    Thanks scott, Appreciate you great help

  12. DB Conner says:

    Good info on array parameter trick. In 2012, still no documentation on that

  13. Tasha K says:

    Great info! Could you point me how you are defining the Ads list (or any multilevel part of a request object)? My WCF test client is not showing my list property inside my request object at all.

Skip to main content