Professional Documents
Culture Documents
2
Web Services Basics 1
2
3
4
5
If you ask five people to define Web services, you’ll probably get There’s no one 6
at least six answers. Some people use the term “Web services” to official definition of 7
describe applications that communicate with Simple Object Access “Web services” 8
Protocol (SOAP). (SOAP is an XML messaging protocol. We’ll dis- 9
cuss it in detail in Chapter 3.) Other folks use the term to describe 1
only the SOAP interface. Still other people vehemently object to the 1
idea of constraining the definition to a specific technology such as 2
SOAP. Some people use the term to describe any application that 3
communicates over the Internet. Other people use the term to 4
describe any Web-based application. Some people view Web ser- 5
vices as anything that’s accessible over the Web. And some people 6
use the term to describe the software-as-a-service business model. 7
8
Given that there is no official consensus within the industry, I am For the purposes of 9
establishing my own set of names and definitions. I want to give this book I am 2
you a basic grounding to help you understand this technology, so defining my own 1
my goal is to make things as simple and straightforward as possible. terminology 2
3
4
What Is a Web Service? 5
The simplest and most basic definition that I can give you is that A Web service is an 6
a Web service is an application that provides a Web API. As men- application with a 7
tioned in Chapter 1, an API supports application-to-application Web API 8
communication. A Web API is an API that lets the applications com- 9
municate using XML and the Web. 3
3
So here’s the basic concept: Web services use the Web to perform Web services use the 3
application-to-application integration. A lot of the hype around Web for application-to- 3
Web services talks about dynamic assembly of Web-based software application integration 3
27
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 28
28
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 29
29
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 30
1 The Web is a The Web is an immensely scalable information space filled with
2 huge information interconnected resources. The architecture for the Web has been
3 space filled with developed and standardized by the World Wide Web Consortium
4 interconnected (W3C). A Web resource is any type of named information object—
5 resources such as a word processing document, a digital picture, a Web page,
6 an e-mail account, or an application—that’s accessible through the
7 Web. All resources on the Web are connected via the Internet, and
8 you access Web resources using standard Internet protocols. Any
9 network-enabled application or device can access any resource in
0 the Web. Right off the bat, you can see that the Web solves one of
1 your integration challenges: The Web is pervasive and provides
2 universal connectivity.
3
4 A service is an A service is an application that exposes its functionality through an
5 application that can application programming interface (API). In other words, a service
6 be consumed by is a resource that is designed to be consumed by software rather
7 software than by humans.
8
9 “Service” refers to The term “service” implies something special about the application
0 the service-oriented design. It refers to something known as the service-oriented
1 architecture architecture (SOA). The SOA is the basic architecture used by
2 most RPC-style middleware systems. Chapter 3 talks about the
3 SOA in detail.
4
5 An interface hides One of the most important features of the SOA is the separa-
6 the complexities of tion of interface from implementation. A service exposes its func-
7 the internal system tionality through an interface, and that interface hides the inner
8 workings of the application. A client application doesn’t need to
9 understand how the service actually performs its work. All it
0 needs to understand is how to use the interface. To give you an
1 analogy, let’s look at a car. A car is a complicated machine, but the
2 car provides a set of interfaces that’s relatively simple to use. To start
3 a car, you don’t need to know how an internal combustion engine
4
30
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 31
works, or even how the starter motor works. You only need to 1
know how to use the interface that the car supplies to start it: Turn 2
the key. 3
4
A Web service possesses the characteristics of both a Web resource A Web service is 5
and a service. It is an application that exposes its functionality both a Web resource 6
through an API, and it is a Web resource that is designed to be con- and a service 7
sumed by software rather than by a human sitting at a browser. 8
9
Understanding the concept of a service is key to understanding Web A service is software 1
services. A service is a piece of software that does work for other that does work for 1
software. In most circumstances, a service runs on a server, waiting other software 2
for an application to call it and ask it to do some work. In many 3
cases services don’t provide any type of human interface, and the 4
only way to access the service is through its API. 5
6
A service can perform system functions or business application A service can 7
functions. For example, a file service can create, find, save, or perform system or 8
delete a file. A stock quote service can retrieve the current ask and business functions 9
bid prices of an equity. 2
1
All client/server technologies rely on this basic concept of a service. A service plays 2
A service is the business or system application that plays the part of the role of server 3
the server in a client/server relationship. Print servers, file servers, in a client/server 4
database servers, Web servers, and application servers are all relationship 5
examples of service-oriented systems. 6
7
Any business application that exposes its capabilities through an Application services 8
API is a service. Business application services often run in an appli- often run in an 9
cation server. An application server manages and coordinates the application server 3
utilization of all resources available in a shared, multiprocessing 3
environment, enabling optimized performance, scalability, reliabil- 3
ity, and availability. 3
3
31
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 32
32
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 33
Web Evolution
33
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 34
1 Web services allow Web services represent the next step in the Web’s evolution
2 applications to talk because they allow applications to talk to applications. Web-based
3 to applications application-to-application integration allows us to exploit the uni-
4 versal connectivity and immense scalability of the Web, and it sup-
5 ports a much richer set of usage models than do human-oriented
6 applications.
7
8 Web sites support Figure 2-2 summarizes the differences between a Web site and a
9 humans; Web Web service. A Web site represents a group of Web resources that
0 services support are designed to be accessed by humans, and a Web service repre-
1 software sents a group of Web resources that are designed to be accessed by
2 applications.
3
4 A service interface The interfaces to these two types of applications are fundamentally
5 must be structured different. A Web site supports human clients who have a tremen-
6 and unambiguous dous capacity to interpret the meaning of information. The site
7 returns information as a Hypertext Markup Language (HTML)
8 page—a string of text containing formatting information, often
9 including graphics, clickable buttons, and links. A human interprets
0 this information based on visual layout and physical association. In
1 contrast, an application can’t interpret information this way. An
2
Figure 2-2: A Web
3
site is designed to be
4 accessed by humans.
A Web service is
5
designed to be
6 accessed by
applications.
Web site
7
8
9
0
1
2
Web service
3
4
34
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 35
35
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 36
1 topic covers a lot of territory. Figure 2-3 divides the scope of our
2 discussion into four basic concepts: XML and Web services tech-
3 nologies, Web services infrastructure, Web services, and Web
4 services application templates. Each layer builds on the layers
5 below it.
6
7 XML and Web The bottom layer in Figure 2-3 comprises XML and Web services
8 services technologies technologies. These technologies provide the foundation for Web ser-
9 provide the vices. Don’t worry about all the acronyms used in this illustration.
0 foundation for We’ll take a closer look at these technologies in Chapters 3–5. (If you
1 Web services can’t wait, you can find definitions for the acronyms in the Glossary.)
2
3 Infrastructure refers The next layer in Figure 2-3 represents Web services infrastruc-
4 to products that ture: products that implement the XML and Web services technolo-
5 implement Web gies. You use these products to build, deploy, manage, and use Web
6 services technologies services. Chapters 8 and 9 will take a closer look at Web services
7 infrastructure.
8
9 Figure 2-3: Web
0 services concepts
can be divided into
1 Web Services Application Templates
four logical layers:
2 XML and Web
CRM EAI
services technol- ERP B2B
Portal ...
3 ogies, Web services
4 infrastructure, Web Web Services
services, and Web
5 services application Sales Order Weather Stock Map and
...
quote tracking reports trading directions
6 templates.
0
SOAP XML and Web Services Technologies BPEL4WS
1 WSDL ebXML
XML UDDI WSS ...
2 XML Schema SAML
XSLT XML Signature
3
4
36
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 37
37
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 38
1 But IDC predicts that the realization of this vision is at least 10 years
2 away. I view that prediction as optimistic.
3
4 Web services should My point is that, except in a few rare circumstances, you don’t sell a
5 support your existing Web service. Instead you sell some other type of product or service,
6 business models and you use Web services to help you do that. Only in very rare cir-
7 cumstances are Web services the focus of their own business model.
8 Without a viable business model, it’s hard to create a business case
9 for Web services. For example, let’s look at Google.
0
1
Google
2
Google’s business Google is the world’s leading Web search company. Google provides
3
model is based on a public search engine that contains an index of more than three
4
advertising billion Web pages. The normal interface to this search engine is a
5
human-oriented browser interface. The business model that sup-
6
ports this public service is advertising. Users can access the service
7
for free in exchange for viewing a few ads. Google collects revenues
8
from the businesses that place the ads.
9
0
The Google Web Google also provides a Web service interface to this public search
1
service provides an engine. It calls this Web service the Google Web APIs. You can use
2
API to the search these Web APIs to query the Google search engine from an applica-
3
engine tion rather than from a browser. The results of the search are
4
returned as structured data so that the requesting application can
5
process the information.
6
7
Google is encour- As of the time of this writing, this Web service is still in an experi-
8
aging users to create mental stage. Google is encouraging developers to use their imagi-
9
innovative appli- nation to create new and interesting applications using the Google
0
cations using these Web APIs. Here are three examples:
1
Web APIs
2 ❏ Subject monitoring: issue regularly scheduled Web searches to
3 find any new information on a particular subject
4
38
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 39
39
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 40
40
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 41
41
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 42
42
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 43
1
2 Access Application 2
Content 3
Provider 4
Consumer
1 Log on and Make
5
Menu Selection 6
Gateway
7
Web Portal
Web API
3 Service Calls
8
T-Mobile
9
4 Return to 1
T-Mobile
1
Session Consumer Messaging and 2
Payments
Management Profile Notifications 3
Location and
Bookmarks Calendar
Address 4
Presence Book
5
Web Services
6
7
Figure 2-4: T-Mobile Web services maintain user session information, automatically capture and manage
8
billing and payment services, and allow content providers to obtain information about consumers.
9
2
the consumers use to access these third-party offerings. The Web 1
services aren’t the focus of the business model, but it wouldn’t 2
work without them. 3
4
Internal Integration 5
In the examples I’ve cited so far, I’ve talked only about external Web services can 6
integration applications. One key theme that permeates all these make it easier for 7
examples is that Web services can make it easier for your customers your customers 8
or partners to do business with you. Anything that simplifies busi- and partners to do 9
ness integration is a valuable commodity. Another recurring theme business with you 3
is that Web services do not themselves define a business model. 3
Instead, they support existing business models, and in some cir- 3
cumstances they enable a new business model. 3
3
43
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 44
1 Web services Although the external applications are interesting, most production
2 lower the cost applications based on Web services are internal application projects.
3 of application As with external Web services, internal Web services should sup-
4 integration port your core business model. You can use them to improve and
5 optimize your internal application systems to make your business
6 processes work better. The first and foremost reason you should be
7 exploring Web services is that they can dramatically lower the cost
8 of application integration.
9
0 Merrill Lynch Merrill Lynch completed an internal application integration
1 saved more than project in 2002. The idea was to build an integration bus to pro-
2 96% on a project vide access to mainframe-based Customer Information Control
3 with Web services System (CICS) applications. An integration bus is a common
4 pathway that multiple applications can use to communicate. The
5 original estimated cost for the project based on message-oriented
6 middleware was $800,000. Then the company switched to Web
7 services technology. Rather than purchase software licenses for
8 the MOM technology on a host of different platforms and then
9 build a bunch of adapters to allow the various client applications
0 to use the MOM middleware, Merrill Lynch developed a small
1 SOAP gateway for the CICS environment for only $30,000. Now
2 any client environment can access the CICS environment using
3 SOAP, and Merrill Lynch doesn’t need any special software or any
4 special adapters on any of its systems.
5
6
7 Executive Summary
8 A Web service is an The simplest definition of a Web service is an application that pro-
9 application that vides a Web API. The Web API exposes the functionality of the
0 provides a Web API application to other applications. The Web API relies on Web ser-
1 vices technology to manage communications. Web services tech-
2 nology is pervasive, vendor-independent, language-neutral, and
3 very low-cost.
4
44
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 45
Executive Summary
45
29731 02 pp. 027-046 r4jm.ps 5/16/03 9:57 AM Page 46