9.10. Connecting to a WCF Endpoint
When VWD creates a Windows Communication Foundation service, it makes the service discoverable by clients. You can see the Web Service Description Language (shortened to WSDL and pronounced wizz-dell in geekspeak) details by tacking on a query string to the URL:
http://www.kjopc.com/service.svc?wsdl
Everything you need to know about connecting to the service is in the WSDL definition. Fortunately, the built-in tools decipher it for you and create whatever else you need to connect.
Follow these steps to connect to the WCF service:
Choose WebsiteAdd Service Reference.
The Add Service Reference window appears.
In the Address text box, enter the URL of the daylight saving WCF service (for example, http://www.kjopc.com/service.svc) and click Go.
The utility downloads the service information (this step can be slow) and lists the available services and operations, as shown in Figure 9-5.
Accept the default values in the Add Service Reference window and click OK.
VWD puts several files into a new folder called App_WebReferences.
Open the web.config file and locate the <system.serviceModel> element and within it, the <client> element.
In the <endpoint> element, check that the address value is pointing to the URL where the service is located and fix it, if necessary.
For example, the endpoint address for my service is
<endpoint address="http://www.kjopc.com/service.svc" ...
Get ASP.NET 3.5 For Dummies® 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.