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 named 'NorthwindEntities' could be found in the application config file. This means you forgot to copy the connection string from the DAL project to the service project.
If you get an error that says Schema specified is not valid. Errors: Northwind...