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.

CHAPTER 6 ■ DEPLOYING YOUR WEB SITE 149<br />

want it to do! So, the first thing you should do is update your client references to your<br />

newly deployed service tier on your server.<br />

When you originally built the client tier, you added a web reference to the server<br />

running on the Visual Studio development web server, Cassini. The important thing to<br />

remember to prevent breaking your code is the name that you gave the reference. Looking<br />

back through Chapter 5, you’ll note we named the web reference AddressData. This is<br />

because once you remove the reference, the proxy class will be destroyed, your code will<br />

no longer recognize it, <strong>and</strong> your code will thus not compile. When you create the new<br />

web reference to the deployed service, should you give it the same name, then a new<br />

proxy class with that name will be created, <strong>and</strong> your code will compile again.<br />

To destroy the reference, right-click AddressData in the Solution Explorer <strong>and</strong> then<br />

select Delete (see Figure 6-21).<br />

Figure 6-21. Removing the web reference<br />

Now you just need to find the WSDL of your deployed service, which will look something<br />

like this:<br />

http://server/servicetier/service.asmxWSDL<br />

(If you created the virtual web service tier on the server when deploying the service<br />

in the last step, you’ll have this URL. Otherwise, use the virtual web that you created.)<br />

Remember to use AddressData as the name of the new service reference, <strong>and</strong> your client<br />

should be ready to deploy.<br />

Now, deployment is simply a matter of using the Copy <strong>Web</strong> Site tool as you did in the<br />

previous section (Figure 6-18) to add your site to the server. At this point, your server<br />

should have a ServiceClient web site that contains your client. This references a web<br />

service on the ServiceTier web site, which wraps the database access. You can now call

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

Saved successfully!

Ooh no, something went wrong!