Testing the service with the WCF Test Client

Now, we can run the program to test the GetProduct and UpdateProduct operations with the WCF Test Client.

Note

You might need to run Visual Studio as an administrator to start the WCF Test Client. You can refer to Chapter 2, Hosting the HelloWorld WCF Service, for more details on how to set up your WCF development environment.

First, set NorthwindService as the startup project and then press Ctrl + F5 to start the WCF Test Client. Double-click on the GetProduct operation, enter a valid product ID, and click on the Invoke button. The detailed product information should be retrieved and displayed on the screen, as shown in the following screenshot:

Note

You might get an error that says No connection string ...

Get WCF Multi-layer Services Development with Entity Framework Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.