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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

172<br />

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

Figure 7-6. Viewing the AddressService harness<br />

The next thing to do is to create a client that allows you to access this service. You’ll<br />

see how to do this in the next section.<br />

Creating the Address Service Client<br />

To create a service client, you use the svcutil.exe tool that comes with the Windows SDK<br />

or as part of the Orcas add-ons to Visual Studio. You’ll find it in the Program Files\<br />

Microsoft Visual Studio 8\Common7\IDE folder.<br />

In the service harness of your service, you can see the WSDL file that defines the<br />

service interface. In the simplest case, you just pass this as a parameter to svcutil.exe,<br />

<strong>and</strong> two files will be created for you. These are a proxy class <strong>and</strong> a configuration file.<br />

So, from a comm<strong>and</strong> prompt, type the following:<br />

Svcutil http://localhost:49906/FirstWCF/Service.svcwsdl<br />

■Note Remember to replace the URL with that of the WSDL in your service.

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

Saved successfully!

Ooh no, something went wrong!