A Web Services Primer
IntroductionLooking back over the last six years, it is hard to imagine networked computing without the Web. The reason why the Web succeeded where earlier hypertext schemes failed can be traced to a couple of basic factors: simplicity and ubiquity. From a service provider's (e.g. an e-shop) point of view, if they can set up a web site they can join the global community. From a client's point of view, if you can type, you can access services. From a service API point of view, the majority of the web's work is done by 3 methods (GET, POST, and PUT) and a simple markup language. The web services movement is about the fact that the advantages of the Web as a platform apply not only to information but to services.
By "services", I don't mean monolithic coarse-grained services like Amazon.com, but, rather, component services that others might use to build bigger services. Microsoft's Passport, for instance, offers an authentication function exported on the Web. So hypothetically, an electronic newspaper like the Washington Post can avoid creating its own user authentication service, delegating it to Passport.
Oracle's dynamic services whitepaper provides other examples of component services that are reusable building blocks: currency conversion, language translation, shipping, and claims processing, A more formal definition of a web service may be borrowed from IBM's tutorial on the topic.
Web services are a new breed of Web application. They are self-contained, self-describing, modular applications that can be published, located, and invoked across the Web. Web services perform functions, which can be anything from simple requests to complicated business processes...Once a Web service is deployed, other applications (and other Web services) can discover and invoke the deployed service.
IBM's web services tutorial goes on to say that the notion of a web service would have been too inefficient to be interesting a few years ago. But the trends like cheaper bandwidth and storage, more dynamic content, the pervasiveness and diversity of computing devices with different access platforms make the need for a glue more important, while at the same time making the costs (bandwidth and storage) less objectionable.
|Table of Contents|
Why bother with the Web, you say, when I've got my favorite middleware platform (RMI, Jini, CORBA, DCOM etc.)? While middleware platforms provide great implementation vehicles for services, none of them is a clear winner. The strengths of the Web as an information distributor, namely simplicity of access and ubiquity, are important in resolving the fragmented middleware world where interoperability is hard to come by. The Web complements these platforms by providing a uniform and widely accessible interface and access glue over services that are more efficiently implemented in a traditional middleware platform.
Viewed from an n-tier application architecture perspective, the web service is a veneer for programmatic access to a service which is then implemented by other kinds of middleware. Access consists of service-agnostic request handling (a listener) and a facade that exposes the operations supported by the business logic. The logic itself is implemented by a traditional middleware platform.
Generic Web Service Architecture
So what is the web service platform? The basic platform is XML plus HTTP. HTTP is a ubiquitous protocol, running practically everywhere on the Internet. XML provides a metalanguage in which you can write specialized languages to express complex interactions between clients and services or between components of a composite service. Behind the facade of a web server, the XML message gets converted to a middleware request and the results converted back to XML.
Wait a minute, you say, access and invocation are only the bare bones (this would be like saying CORBA is only IDL plus remote procedure calls). Life is never quite that simple. What about the platform support services -- discovery, transactions, security, authentication and so on -- the usual raft of services that make a platform a platform? That's where you step up to the next level.
The Web needs to be augmented with a few other platform services, which maintain the ubiquity and simplicity of the Web, to constitute a more functional platform. The full-function web services platform can be thought of as XML plus HTTP plus SOAP plus WSDL plus UDDI. At higher levels, one might also add technologies such as XAML, XLANG, XKMS, and XFS -- services that are not universally accepted as mandatory.
Below is a brief description of the platform elements. It should be noted that while vendors try to present the emergent web services platform as coherent, it's really a series of in-development technologies. Often at the higher levels there are, and may remain, multiple approaches to the same problem.
- SOAP (remote invocation)
- UDDI (trader, directory service)
- WSDL (expression of service characteristics)
- XLANG/XAML (transactional support for complex web transactions involving multiple web services)
- XKMS (XML Key Management Specification) - ongoing work by Microsoft and Verisign to support authentication and registration
SOAP is a protocol specification that defines a uniform way of passing XML-encoded data. In also defines a way to perform remote procedure calls (RPCs) using HTTP as the underlying communication protocol.
SOAP arises from the realization that no matter how nifty the current middleware offerings are, they need a WAN wrapper. Architecturally, sending messages as plain XML has advantages in terms of ensuring interoperability (and debugging, as I can well attest). The middleware players seem willing to put up with the costs of parsing and serializing XML in order to scale their approach to wider networks.
Submitted in 2000 to the W3C as a Note by IBM, Microsoft, UserLand, and DevelopMentor, the further development of SOAP is now in the care of the W3C's XML Protocols Working Group. This effectively means that SOAP is frozen and stable until such time as the W3C Working Group delivers a specification.
See also Don Box's Brief History of SOAP.
UDDI provides a mechanism for clients to
dynamically find other web services. Using a UDDI interface,
businesses can dynamically connect to services provided by external
business partners. A UDDI registry is similar to a CORBA trader, or it
can be thought of as a DNS service for business applications. A UDDI
registry has two kinds of clients: businesses that want to publish a
service (and its usage interfaces), and clients who want to obtain
services of a certain kind and bind programmatically to them. The
table below is an overview of what UDDI provides. UDDI is layered over
SOAP and assumes that requests and responses are UDDI objects sent
around as SOAP messages. A sample query is included below.
|Information||Operations||Detailed information (supported by lower-level API)|
|White pages: Information such as the name, address, telephone number, and other contact information of a given business||Publish: How the provider of a Web service registers itself.||Business information: Contained in a BusinessEntity object, which in turn contains information about services, categories, contacts, URLs, and other things necessary to interact with a given business.|
|Yellow pages: Information that categorizes businesses. This is based on existing (non-electronic) standards||Find: How an application finds a particular Web service.||Service information: Describes a group of Web services. These are contained in a BusinessService object|
|Green pages: Technical information about the Web services provided by a given business.||Bind: How an application connects to, and interacts with, a Web service after it's been found||Binding information: The technical details necessary
to invoke a Web service. This includes URLs, information about
method names, argument types, and so on. The
represents this data.
Service Specification Detail: This is metadata about the various specifications implemented by a given Web service. These are called tModels in the UDDI specification
There is no near-term plan in UDDI to support full-featured discovery (e.g. geography-limited searches or bidding and contract negotiation supported by vendors like eLance). UDDI expects to be the basis for higher level services supported by some other standard. There are plans for UDDI to support more complex business logic, including support for hierarchical business organizations. UDDI has fairly broad support; IBM, Ariba, and Microsoft are driving it. It's not yet an open standard.
Query: The following query, when placed inside the body of the SOAP envelope, returns details on Microsoft.
<find_business generic="1.0" xmlns="urn:uddi-org:api">
Result: detailed listing of <businessInfo> elements currently registered for Microsoft, which includes information about the UDDI service itself.
<businessList generic="1.0" operator="Microsoft Corporation" truncated="false" xmlns="urn:uddi-org:api"> <businessInfos> <businessInfo businessKey="0076B468-EB27-42E5-AC09-9955CFF462A3"> <name>Microsoft Corporation</name> <description xml:lang="en"> Empowering people through great software - any time, any place and on any device is Microsoft's vision. As the worldwide leader in software for personal and business computing, we strive to produce innovative products and services that meet our customer's </description> <serviceInfos> <serviceInfo businessKey="0076B468-EB27-42E5-AC09-9955CFF462A3" serviceKey="1FFE1F71-2AF3-45FB-B788-09AF7FF151A4"> <name>Web services for smart searching</name> </serviceInfo> <serviceInfo businessKey="0076B468-EB27-42E5-AC09-9955CFF462A3" serviceKey="8BF2F51F-8ED4-43FE-B665-38D8205D1333"> <name>Electronic Business Integration Services</name> </serviceInfo> <serviceInfo businessKey="0076B468-EB27-42E5-AC09-9955CFF462A3" serviceKey="611C5867-384E-4FFD-B49C-28F93A7B4F9B"> <name>Volume Licensing Select Program</name> </serviceInfo> <serviceInfo businessKey="0076B468-EB27-42E5-AC09-9955CFF462A3" serviceKey="A8E4999A-21A3-47FA-802E-EE50A88B266F"> <name>UDDI Web Sites</name> </serviceInfo> </serviceInfos> </businessInfo> </businessInfos> </businessList>