WCF Test Client (WcfTestClient.exe) - WCF (2024)

  • Article

Windows Communication Foundation (WCF) Test Client (WcfTestClient.exe) is a GUI tool that enables 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.

You can typically find the WCF Test Client (WcfTestClient.exe) in the following location: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE - Community may be one of "Enterprise", "Professional" or "Community" depending on which level of Visual Studio is installed.

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 debug a service project that contains multiple services. When WCF Test Client opens, it automatically iterates the list of services in your project and opens them for testing.

Outside Visual Studio

You can also invoke the WCF Test Client (WcfTestClient.exe) outside Visual Studio to test an arbitrary service on the Internet. To locate the tool, go to the following location:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE (where community can be one of "Enterprise", "Professional" or "Community" depending on which level of Visual Studio is installed on the machine)

To use the tool, double-click the file name to open it from this location, or launch it from a command line.

WCF Test Client takes an arbitrary number of URIs as command line arguments. These are the URIs of services that can be tested.

wcfTestClient.exe URI1 URI2 …

After the WCF Test Client window is opened, click File->Add Service, and enter the endpoint address of the service you want to open.

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 an operation, you can view its content in the right pane inside a new tab with the operation's name.

The left pane also lists client configuration files. Double-click any of the items to display the content of the file in a new tabbed window in the right pane.

Entering Test Parameters

To view the test parameters, double-click an operation to open it in the right pane. The parameters are showed in Formatted view by default, and you can enter arbitrary values for the parameters to test the service.

To view the message's XML, click XML. To send them to the service, click Invoke.

For a DataSet parameter, click the button next to Edit… to edit it in a new window showing the DataGrid. Notice the appearance of the Copy DataSet and Paste DataSet buttons. If the schema of the DataSet object is unknown upon the first edit, the DataGrid is empty. You have to paste a DataSet object with the same schema into the current object in the DataGrid. (Notice that you need to copy the schema from somewhere else before the paste operation.) You can also copy a Dataset object for future usage by clicking the Copy DataSet button.

The service's response appears below the test parameters.

Note

If the expected return value is a string, the result will be displayed as a quoted string even though the input provided was not in quotes.

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, a dialog box pops up to notify you that the message was successfully sent.

Session Support

The Start a new proxy check box in a service operation's tab enables you to toggle session support. This box is cleared by default.

When you enter test parameters for a specific operation (or another operation in the same service endpoint) and click Invoke multiple times with the check box cleared, these operations share one proxy and the service status is persisted across multiple operations.

If the Start a new proxy check box is checked, a new proxy is started for each Invoke, the previous session scenario is ended, and the service status is reset.

Editing Client Configuration

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

Edit with Service Configuration Editor

Right-click Config File in the left pane and select the context menu Edit with SvcConfigEditor. Service Configuration Editor is launched with the client configuration content. You can edit the configuration and save it within the tool.

After saving the file in Service Configuration Editor, WCF Test Client displays a warning message to inform you that the file has been modified outside and asks whether you would like to reload it.

If you select Yes, the configuration content in the "Client.dll.config" tab reflects the changes you made in the editor.

If you select No, the configuration content in the "Client.dll.config" tab remains unchanged and the modified content is automatically saved to the source file.

Restore to Default Configuration

If you want to cancel all the changes and restore to the default client configuration, right-click Config File in the left pane and select the context menu Restore to Default Config. The default configuration value is loaded and content in "Client.dll.config" tab is restored.

Validate Changes

When saved changes are being loaded in WCF Test Client, the configuration is checked for validity against WCF schema. If errors are found, a dialog box is displayed to show error details.

During proxy generation, binary compiling, or service invoking, menu items that support editing (that is, "Edit …", "Restore …", and so on) are disabled. Service invocation is also disabled when loading updated configuration to WCF Test Client.

Persist Client Configuration

The Tools->Options->Client Configuration tab contains an Always Regenerate Config When Launching Services option, which is enabled by default. This option specifies that every time WCF Test Client loads a service, it regenerates a configuration file based on the latest service contract and service App.config files.

If you have edited the client configuration for your WCF service and want to always use this updated file to debug your service, you can uncheck the Regenerate option. By doing so, even when you update the service and reopen WCF Test Client, the Client.dll.config file is the one you updated previously instead of a regenerated one based on the updated service.

However, you might need to edit the configuration file to make it consistent with the regenerated proxy. If the regenerated proxy and configuration file are mismatched due to an updated service, errors will occur when the service is invoked.

Caution

If you have modified the client configuration file and select to reuse it in the future, you can find the file in the following location:

\Documents and Settings\[User Account]\My Documents\Test Client Projects.

Any updated credential information stored to the client configuration file is protected by the Access Control List (ACL) of this folder.

Adding, Removing and Refreshing Services

Add Service

Click File->Add Service to add a service to WCF Test Client. You are then required to type the URI (endpoint address) of the service to be added. The service’s address can be a mex address or WSDL address.

You can also find a list of 10 recently added services' endpoints in the Recent Services submenu. If you select one of them, the specified service is added to WCF Test Client.

You can also right-click the root of service tree My Service Projects, and select Add Service to achieve the same result.

During proxy generation, binary compiling, or service invocation, menu items that support adding a service are disabled. Service invocation is also disabled.

Remove Service

Right-click the service root of the service to be removed, and select Remove Service to remove a service from WCF Test Client.

During proxy generation, binary compiling, or service invocation, menu items that support removing a service are disabled. Service invocation is also disabled.

Refresh Service

If a change is made to the service while WCF Test Client is running and you want to ensure that the WCF Test Client implementation for that service is up-to-date, right-click the service root of the service, and select Refresh Service. Note that after refreshing, the service status is reset.

During proxy generation, binary compiling, or service invocation, menu items that support refreshing a service are disabled. Service invocation is also disabled.

Location of Files Generated by the Test Client

By default, WCF Test Client stores generated client code and configuration files in the "%appdata%\Local\temp\Test Client Projects" folder. This folder is deleted after WCF Test Client exits. If a configuration file is modified in WCF Test Client and the Always Regenerate Config When Launching Services option is disabled, the modified file is copied to the "CachedConfig" folder under "My Documents\Test Client Projects" with a mapping (metadata-address-to-file-name) XML file as an index.

You can also start WCF Test Client in a command line, use the /ProjectPath switch to specify a new desired path for storing generated files, or use the /RestoreProjectPath switch to restore the default location. The syntax is as follows:

wcfTestClient.exe /ProjectPath [desired location]

Running this command does not open WCF Test Client. Only the folder location is changed. You can run this command whether WCF Test Client is running or not. The new location is applied when WCF Test Client is restarted. The location information can be saved in registry, or in the WcfTestClient.exe.option file in the "%appdata%\Local\temp\Test Client Projects" folder.

Features supported by WCF Test Client

The following is a list of features supported by WCF Test Client:

  • Service Invocation: Request/Response and One-way message.

  • Bindings: all bindings supported by Svcutil.exe.

  • Controlling Session.

  • Message Contract.

  • XML serialization.

The following is a list of features not supported by WCF Test Client:

  • Types: Stream, Message, XmlElement, XmlAttribute, XmlNode, types that implement the IXmlSerializable interface, including the related XmlSchemaProviderAttribute attribute, and the XDocument and XElement types and the ADO.NET DataTable type.

  • Duplex contract.

  • Transaction.

  • Security: CardSpace , Certificate, and Username/Password.

  • Bindings: WSFederationbinding, any Context bindings and Https binding, WebHttpbinding (Json response message support).

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 of these actions also shut down WCF Service Auto Host and stop the Visual Studio debugging process if WCF Test Client was launched by Visual Studio.

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

See also

  • WCF Service Host (WcfSvcHost.exe)
WCF Test Client (WcfTestClient.exe) - WCF (2024)

FAQs

WCF Test Client (WcfTestClient.exe) - WCF? ›

Windows Communication Foundation (WCF) Test Client (WcfTestClient.exe) is a GUI tool that enables users to input test parameters, submit that input to the service, and view the response that the service sends back.

How to test WCF service using WCFTestClient? ›

Test the Service

From the main menu, click DEBUG > Start Without Debugging. This starts the service and invokes the WCF Test Client window. The left pane shows the endpoint for your service and the operations that are exposed. In the left pane, double-click the Read() operation.

How to use WCF service in client application? ›

Creating a WCF Client Application
  1. Right-click the project in the Solution Explorer and select "Add Service Reference".
  2. In the "Address" box, enter the URL of your WCF service and click "Go".
  3. Once the service is found, enter a namespace (e.g., "MyService") and click "OK".
Jul 15, 2023

How do I test a self hosted WCF service? ›

The easiest way to debug a self-hosted WCF is to configure Visual Studio to launch both client and server when you choose Start Debugging on the Debug menu. If the WCF service is self-hosting inside or a process that cannot be launched in this manner, such as NT service, you cannot use this method.

What is WCFStorm? ›

Create functional and load and performance test cases. WCFStorm is a full-featured tool capable of testing both WCF and Web Services. It allows users to create functional test cases and load/performance test cases which can be saved into a project.

Where is WcfTestClient.exe located? ›

You can typically find the WCF Test Client (WcfTestClient.exe) in the following location: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE - Community may be one of "Enterprise", "Professional" or "Community" depending on which level of Visual Studio is installed.

How do I start the WCF test client in Visual Studio? ›

Visual Studio provides you a test client to run and debug the service. To use this test client, select your service in Solution Explorer ( CustomerProfile. svc ) and, from the Debug menu, select Start Debugging (or just press F5). Visual Studio will run the code in debug mode using the WCF Test Client, as shown in ...

How do I add a WCF service reference to a Web application? ›

In Solution Explorer, right-click the name of the project to which you want to add the service, and then click Add Service Reference. The Add Service Reference dialog box appears. In the Address box, enter the URL for the service, and then click Go to search for the service.

How to start WCF service from command line? ›

The WCF service can only respond to clients if the Windows service is running. To start the service, right-click it in the SCM and select "Start", or type net start WCFWindowsServiceSample at the command prompt. If you make changes to the service, you must first stop it and uninstall it.

How do I activate WCF service? ›

Activate Windows Communication Foundation (WCF)
  1. From the Start menu, select Administrative Tools > Server Manager.
  2. Select Add roles and features from the Dashboard.
  3. Select Next twice.
  4. Select Features.
  5. In the Features area, expand the: - . ...
  6. Under WCF Services select: - HTTP Activation.

How do I check my WCF connection? ›

Instead of creating a console application or a client application to test the service we will use the predefined tool wcftestclient.exe.
  1. Open Visual Studio command prompt and type wcftestclient then Enter.
  2. After pressing Enter, we get a GUI application of the WCF Test Client.
Feb 14, 2011

How do I call a WCF service from a URL? ›

With the service running, right click the project that will contain the WCF client proxy and select Add > Service Reference. In the Add Service Reference Dialog, type in the URL to the service you want to call and click the Go button. The dialog will display a list of services available at the address you specify.

How do I run a local WCF service? ›

To open WCF Test Client, open Developer Command Prompt for Visual Studio and execute WcfTestClient.exe. Select Add Service from the File menu. Type http://localhost:8080/hello into the address box and click OK. Make sure the service is running or else this step fails.

How do I test my WCF SOAP service? ›

Instead of creating a console application or a client application to test the service we will use the predefined tool wcftestclient.exe.
  1. Open Visual Studio command prompt and type wcftestclient then Enter.
  2. After pressing Enter, we get a GUI application of the WCF Test Client.
Feb 14, 2011

How to test WCF service using svcutil? ›

Compile your service into an executable file and one or more dependent assemblies. At the command prompt, launch the Svcutil.exe tool using the following format. For more information on the various parameters, see the Service Validationsection of the ServiceModel Metadata Utility Tool (Svcutil.exe) topic.

How do I run a WCF service? ›

To open WCF Test Client, open Developer Command Prompt for Visual Studio and execute WcfTestClient.exe. Select Add Service from the File menu. Type http://localhost:8080/hello into the address box and click OK. Make sure the service is running or else this step fails.

How to test WCF service using Fiddler? ›

To set it up in Fiddler, you first have to go to Tools | Fiddler options | Connections. Set the proxy port to the desired value; in my case, 8888 . Then you have to forward the traffic, coming to the proxy, to the WCF service in question.

References

Top Articles
20+ Amazing Scripture Tattoos for Women
Best Roasted Broccoli Recipe - A Beautiful Plate
Hickory Back Pages
Edutone Skyward
Meet Scores Online 2022
Minecraft Jenny Mod Dragon Staff
Rs3 Rituals
Chase Bank Pensacola Fl
Super Nash Bros Tft
Apple Store Near Me Make Appointment
Join MileSplit to get access to the latest news, films, and events!
Mo Money Login
How to Sign Out of Microsoft Outlook: Step-by-Step Guide - Solve Your Tech
Black Panther Pitbull Puppy For Sale
Amazing Lash Bay Colony
Fd Photo Studio New York
Craigs List Jonesboro Ar
309 Marshall Passage
First Lady Nails Patchogue
Holly Ranch Aussie Farm
Gem City Surgeons Miami Valley South
What is a Nutmeg in Soccer? (Explained!) - Soccer Knowledge Hub
G122 Pink Pill
Amex Platinum Cardholders: Get Up to 10¢ Off Each Gallon of Gas via Walmart Plus Gas Discount
Restaurants Near Defy Trampoline Park
Fortnite Fap Hero
Amerikaanse dollar bestellen | USD kopen
Sams Gurnee Gas Price
Claw Machine Random Name Picker
Spn 102 Fmi 16 Dd15
Academy Sports Meridian Ms
St Cloud Rants And Raves
Lincoln Access Rewards Redemption
David Mayries
Nikki Porsche Girl Head
Gym Membership & Workout Classes in Lafayette IN | VASA Fitness
Mission Impossible 7 Showtimes Near Regal Willoughby Commons
Chalupp's Pizza Taos Menu
Papa Louie When Pizzas Attack Unblocked
Netdania.com Gold
N9K-C9372Px E Eol
Star News Mugshots
Bernadette Peters Nipple
Walmart Careers Com Online Application
Ihop Ralph Ave
Registrar Utd
Kathy Park Wedding
Top-Filme und Serien mit Maggie Smith
Ebony Grinding Lesbian
Uk Pharmacy Turfland
Kirstin Kresse
Varsity Competition Results 2022
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 5950

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.