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 Website
Add 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" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access