Using WCF Test Client (wcfTestClient.exe)

Windows Communication Foundation (WCF) Test Client (svcTestClient.exe) is a GUI tool that allows users to input test parameters, submit that input to the service, and view the response that the service sends back. It provides a seamless service testing experience when combined with WCF Service Host.

Scenarios for Using Test Client

The following sections discuss the most common scenarios in which you can use WCF Test Client to streamline your development process.

Inside Visual Studio

WCF Service Host Starts WCF Test Client with a Single Service

After you create a new WCF service project and press F5 to start the debugger, the WCF Service Host begins to host the service in your project. Then, WCF Test Client opens and displays a list of service endpoints defined in the configuration file. You can test the parameters and invoke the service, and repeat this process to continuously test and validate your service.

WCF Service Host Starts WCF Test Client with Multiple Services

You can also use WCF Test Client to help you debug a service project containing multiple services. When WCF Test Client opens, it automatically iterates the list of services in your project and opens them for testing.

WCF Test Client User Interface

You can use WCF Test Client with a single service or multiple services.

Service Operations

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, you can view its contents in the right pane. The left pane also lists client configuration files. Click any of the items to display the contents of the file in a new tabbed window in the right pane.

Entering Test Parameters

To view the test parameters, double-click on an operation to open it in the right pane, and then click Formatted. To view the message's XML, click XML. When you click Formatted, you can enter arbitrary values for the paramters to test the service. To send them to the service, click Invoke.

Note:
While the operation is in the invoking process, you can switch to another operation or endpoint to view or modify parameters. However, you cannot invoke another operation until the current one finishes.

The service's response appears below the test parameters.

If you specified a particular operation as one-way when you created the contract for the service, no service response is displayed. As soon as the message is queued for delivery, you are notified in the pane that the message was successfully sent.

Viewing Client Configuration

The left pane of the WCF Test Client main window lists client configuration files. Click any of the items to display the contents of the file in the right pane.

Closing WCF Test Client

You can close WCF Test Client in the following ways:

  • On the File menu, click Exit. Alternatively, in the WCF Test Client main window, click Close. Both these actions also shut down WCF Service Host and stop the Visual Studio debugging process.

  • Right-click the WCF Service Host icon in the notification area, and then click Exit. This shuts down both WCF Service Host and WCF Test Client and stops the Visual Studio debugging process.

Send comments about this topic to Microsoft.