hile AJAX is the current rage for building interactive browser-based client applications, the action on the server side has focused on Web services. In fact, Web services have become the de-facto standard for exposing business functions at the server level. Given these conditions, a central development question becomes: How do you enable your AJAX-based applications to communicate with Web services? This article explores how you can use Microsoft Atlas (recently renamed to ASP.NET AJAX) to achieve just that.
To follow along, you'll need Visual Studio 2005 and Microsoft Atlas
downloaded and installed. If you don't have Visual Studio 2005 installed, you can download a free Visual Studio Express version
. This article explains how to interact with Web services through Atlas using an application I've called "ZipCodeRUs." The ZipCodeRUs application retrieves detailed ZIP code information such as the names of cities, counties, and their latitude, longitude, area code, etc. for up to three ZIP codes entered by the user. It relies on a free and publicly available Web service at tilisoft.com
to retrieve the information. The ZipCodeRUs application illustrates Atlas's Web service prowess in two ways:
|Author's Note: Microsoft Atlas also provides the ability to create XML-based declarative bridges to external Web services without having to create conduit services; however, this article does not cover this bridge feature.
|Figure 1. Creating a New Atlas Web Application: When you install the Microsoft Atlas CTP, you'll find a new project template called "'Atlas' Web Site" in the "New Web Site" dialog.|
The full downloadable code for the ZipCodeRUs application
accompanies this article.
Getting Started with Atlas Web Services
In Microsoft Visual Studio, create a new Web application for ZipCodeRUs by selecting the "Atlas Web Site" template as shown in Figure 1
. The "Atlas Web Site" template is installed when you download and install the Microsoft Atlas CTP. The "Atlas Web Site" template creates a Web site that includes a reference to the Microsoft.Web.Atlas.dll
and a Web.config
file that preconfigures the Web site for using Atlas.
If you need to add Atlas capabilities to an existing ASP.NET application you can find the procedure in this Atlas web site in the section titled "Adding Atlas features to an existing ASP.NET application."
Therefore, before you can call an external Web service from your Atlas client, you first need to create a strongly typed proxy. For this example, I've built a C# proxy for the ZipCode Web service and an ASP.NET Web service that serves as a conduit.