Introduction to Web Services
Web services are a new, web-based technology that is gaining
popularity in the industry .
In this lecture, we explore the features that make web services a
powerful new paradigm for computing.
A new airline, Web Air, would like to add car rental services to
their on-line ticket sales system.
The Web Air reservation system operates off of a database of flight
information, but has no knowledge of rental cars.
Web Air’s ticket system must obtain rental data from rental car
What problems could Web Air encounter in gaining this
Rental companies may operate on different platforms.
Example: Mainframes vs. Linux clusters.
Individual rental companies may format rental car
information differently. Example: Using RGB values to
indicate the color of a car, vs. using a string value.
Rental companies may use proprietary formats to store data.
Example: A binary format created for an individual
Access to the data may occur over antiquated or proprietary
protocols. Example: Using Solaris remote procedure calls to
access the data.
Is there an easier way to share data?
One way to simplify data sharing is to apply standards to
interactions between the systems involved.
Web services use a set of standards to simplify machine-to-
Machine-to-machine – autonomous communication between two
systems without the intervention of a user.
How do Web Services simplify the machine-to-machine
communication between Web Air’s ticket sales system and remote
rental car systems?
Exchange Data using XML
XML is an industry standard  for exchanging structured data.
XML is platform independent and is flexible enough to represent
all types of data.
Web services use XML as both the input and output format for all
This standardization means that, regardless of the platforms used
by the rental car agencies, Web Air’s ticket system only needs to
Web Air can read data from rental car Web services using XML,
but how does the ticketing system handle differences in the
formatting of that data?
Web services standards require that the interface for each web
service be published.
The interface is a contract that specifies the available inputs, the
formatting of outputs, and the protocols that the Web service
employs to transmit data.
The interface is described using XML, meaning that machines can
The protocols employed by Web services are Internet standards
such as HTTP, FTP, and SMTP. These protocols have been tested
on very large scales, and operate in existing security paradigms.
Since inputs and outputs are well defined, Web Air’s ticket system
Query rental car Web services using an XML query
generated based on the published interface.
Receive the XML response from the rental car Web service.
Use the known interface to translate the data from each rental
car agency into a format that it can use internally.
Publishing Web service interfaces is advantageous, but where are
Collect Interfaces in Catalogs
Web services standards provide the ability to collect interface
descriptions in a catalog of interfaces.
The catalog is also described using XML and includes information
The provider of the Web service
Cost of using the Web service
The catalog is advertised using traditional media, and is usually
available as both a human digestible Web site and as a Web
Web Air developers can search the catalog for rental car Web
services and interfaces that fit their needs.
Summary of Web Services Advantages
Web services operate purely machine-to-machine, requiring no
XML provides a platform independent method of
communication. Any environment that can read and write text
files can support a Web service.
Since Web services use common Internet protocols, they operate
over existing openings in corporate firewalls.
Restricting operations to well-defined interfaces leads to loose
coupling between Web services.
Loose coupling – Web services are only dependent on the
published interfaces of other Web services. Therefore,
internal changes to a Web service, that do not impact the
interface, have no effect on a network of Web services.
Disadvantages of Web Services
Web services can operate without the knowledge of system
administrators because they require no firewall configuration. May
expose sensitive information to external entities.
Web services require the parsing and transformation of XML,
which is very verbose. This verbosity causes a loss of
performance vs. proprietary methods.
Types of Web Services
Web services can be placed into two broad categories:
aggregators and producers.
Aggregator Web services collect data from one or more Web
services and return the resulting set.
Aggregator Web services do not create any new information.
Producer Web services create new information, or extract existing
information from a non-public source and return the new data.
Producer Web services may collect information from other Web
services to do their work, but they always alter the data in some
manner to make the result original.
Examples of Aggregator Web Services 
Uses a variety of web services, including Google and Amazon, to
aggregate data for a search term.
Feed Burner adds aggregated information from a variety of Web
services to the syndication feeds of web logs (blogs).
Uses the Google Web service (http://www.google.com/apis/) to
collect statistical information about two competing search phrases.
Examples of Producer Web Services
AWSZone.com is an interface for exploring Amazon’s Web
Services (AWS). Technically, AWSZone is an aggregator because
it simply queries AWS and returns the results, but since AWS is a
producer, we list it here.
Flickr is a photo sharing site that offers an extensive set of Web
services (http://www.flickr.com/services/api/) functions that allow
everything from photo management for an individual user to
searching their extensive database of photos.
NOAA offers access to its entire weather database through a set of
Web services functions (http://www.weather.gov/xml/). You can
also view current weather information in an XML format without
any programming (e.g. http://www.weather.gov/data/current_obs/)
Implementing a Web Service in Water
Implementing a Web service in most programming languages is a
Usually requires knowledge of extensive libraries and
Water (http://www.waterlanguage.org) was created to support the
rapid development of Web services.
The following Web service is written in Water and could be used
as an extremely basic calculator.
<defmethod sum x y>
<h1><plus x y/></>
After executing the above code in Water, try the following sums:
 Ricadela, A., Foley, J. New Face Of E-Commerce,
=25600346, July 27, 2004.
 W3C. Extensible Markup Language (XML),
http://www.w3.org/XML/, April 07, 2005.
 Vermeulen, Allan. An e-mail interview, November 9,