Using the WCFTestClient Tool to Test Service Operations

Using the WCFTestClient Tool to Test Service Operations

  • Comments 12

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
  • Thanks, I needed this information today!

  • Hi ,

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

  • Tnx for the array parameter trick

  • Thanks a lot.

  • 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

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

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

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

  • Thank you very much for the tip

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

  • Thanks scott, Appreciate you great help

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

Page 1 of 1 (12 items)
Leave a Comment
  • Please add 4 and 6 and type the answer here:
  • Post