Creating the Client and Adding a Service Reference

Add a new Console project to the current solution and name it BookClient. The first step you have to accomplish is adding a service reference to the WCF service. Right-click the new project name in Solution Explorer and select Add Service Reference. This brings up the Add Service Reference dialog where you need to enter the full Web address of your service. If the service you want to add a reference to is available in the current solution, as in the current example, simply click Discover. The service appears in the dialog, as shown in Figure 41.4.

Figure 41.4 The Add Service Reference dialog enables adding a reference to a WCF service.

image

Click the service name on the left to allow the development server to correctly host the service and discover its members. At this point the dialog lists available contracts (IBookService in this case) and their members. Replace the Namespace identifier with BookServiceReference.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.117.231