08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 7 ■ .<strong>NET</strong> 3.0: WINDOWS COMMUNICATION FOUNDATION 167<br />

Figure 7-5. Service harness with metadata enabled<br />

If you’ve built ASMX web services, you’ll probably be familiar with the ability to test<br />

them with a simple form that is generated for you by the application. Unfortunately, your<br />

WCF service doesn’t offer the same functionality, so you have to use the svcutil.exe tool<br />

to generate a client.<br />

This screen demonstrates how you can do this. The svcutil.exe tool creates a proxy<br />

class that can be used to talk to the service, as well as the desired configuration information<br />

that enables the WCF pipelines to communicate with it. So, if you had for example<br />

enabled security or transactability on your service, the client will be configured to use the<br />

same features automatically.<br />

This is best demonstrated by example, so in the next section, you’ll look at how to use<br />

these attributes to build a “real-life” service. This will extend the examples in the previous<br />

chapters using the address data from the AdventureWorks database.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!