
Beginning ASP.NET 2
.0.pdf








12
Web Ser vices
Web services have been “the next great thing” for a little too long now. They were originally introduced as part of the .NET Framework in its first incarnation (although they have been present in Java for a lot longer). Web services are a method of making information available in a standardized way that could be accessed by any developer’s application over the Web. Web services can form a library or shared repository of information that could be anything from the latest weather forecast, a map of your local amenities, a mathematical function calculator, to the tracks and album cover of the CD that you just inserted into your CD-ROM drive. You should be aware, though, that a web service on its own isn’t an application. Web services aren’t rendered as web pages, or as executable files (.exe); they come completely shorn of a user interface. It’s up to you as a developer to use them and integrate them into your applications. They are there to save you time and effort by reducing code duplication.
They can be used in one of two ways. You can create a web service that is exposed to the Web, to share with other developers and other applications. Or you can search for a web service that can be added to your own application. (They are similar to plug-ins in that respect.) For example, if your application is a company web site and you want to include directions to company headquarters, rather than scan in a map, or attempt to hand-draw one in a graphics tool, why not use one of the web services that makes sections of maps available online?
The information contained in the web service is wrapped up as an XML document, so that worries about platform-specific concerns, such as whether you’re accessing them on an old Windows 98 machine or a turbo-powered Powerbook, simply evaporate. Web services aren’t really anything new either; components have been performing a similar trick for many years now. However, there are some crucial differences. Components had to be distributed by the developer, and they had to be downloaded and installed. These things alone meant that they tended to be tied to one platform. This isn’t true of web services. A key word that emphasises what web services offer is standard. Everything to do with web services is standardized: the method of transmission, the method used to wrap the web service up, the way the web service is defined, all have clear W3C standards associated with the technologies involved. And to make life much easier, all these standards are based on XML. So they’re quick and easy to download, and even easier to use.
