Академический Документы
Профессиональный Документы
Культура Документы
Web Services
Overview
1
10/23/2005
Sang Shin
sang.shin@sun.com
Java™ Technology Evangelist
Sun Microsystems, Inc.
www.javapassion.com/webservices
2
2
10/23/2005
Disclaimer
? Even though Sang Shin is a full-time employee of Sun
Microsystems, the contents here are created as his
own personal endeavor and thus does not reflect any
official stance of Sun Microsystems.
? Sun Microsystems is not responsible for any
inaccuracies in the contents.
3
10/23/2005
Agenda
? Evolution of network computing
? What is Web Services?
? Why Web Services?
? Where is Web Services?
? Web Services Architecture
? Web Services Standards
? Java™ APIs for Web Services
? J2EE as platform of choice for Web Services
? Web Services Tools
? Roadmap and Summary
4
So what are we going to talk about? In the first part of this overview session, I will
spend some time talking about the evolution of distributed computing and see where
web services fits into the whole evolution path. Then I will talk about what and why
aspects of web services. And then I will talk about the reality of web services.
4
10/23/2005
Evolution of
Network Computing
5
10/23/2005
Things - 10 14
Waves of Embedded Computers
10 11
Network Computing Thermostats
Cars
Switches
TVs
Computers
10 8
Packages
Phones
Games Clothes
Desktops
Clients
Functions Transfers
Transfers Transactions
Transactions Content
Content Telemetry
Telemetry Control
Control
IP v4 IP Layer IP v6
Protocols
Organization
10/23/2005
Things - 10 14
Waves of Embedded Computers
10 11
Web
Web Polyarchical
Services
Services
Fractal
10/23/2005
New
X1066 User’s
Service Device
Calendar
Authentication
History of
Distributed Computing
9
10/23/2005
Platform Evolution
The
The Network
Network The
The Computer
Computer Network
Network of
of
Catch
Catch Is
Is the
the Legacy
Legacy to
to Is
Is the
the Embedded
Embedded Network
Network
Phrase
Phrase Computer
Computer Objects
Objects the
the Web
Web Network
Network Things
Things of
of Things
Things
Scale
Scale 100s
100s 1,000s
1,000s 1,000,000s
1,000,000s 10,000,000s
10,000,000s 100,000,000s
100,000,000s 100,000,000s
100,000,000s
When/Peak
When/Peak 1984/1987
1984/1987 1990/1993
1990/1993 1996/1999
1996/1999 2001/2003
2001/2003 1998/2004
1998/2004 2004/2007
2004/2007
Leaf
Leaf XX XX +HTTP
+HTTP +XML
+XML +RM Unknown
+RM Unknown
Protocol(s)
Protocol(s) (+JVM)
(+JVM) Portal
Portal
Directory(s)
Directory(s) NS,
NS, NS+
NS+ +CDS
+CDS +LDAP(*)
+LDAP(*) +UDDI
+UDDI +Jini
+Jini ++??
Schematic
Schematic
This table shows the evolution of distributed computing considering several factors
such as the number participating computing devices or software entities in the
network, interaction behavioral or pattern among the participants, and underlying
technologies used to enable those interactions. The commonality among these
distributed computing technologies is that they are all used to deliver services in one
form or another in a networking environment.
In the beginning, we had a simple client and server model, which has then evolved
into 3-tier and object-based remote computing model, which we will talk about later
again in a bit more detail. Then they evolved into the current state of distributed
computing technologies, which are illustrated in the middle tiers of the table bounded
by a yellow box and they are web-based computing of today and web services
computing of tomorrow. And they are the focus of J2EE architecture and Sun
technologies and products right now.
In the future where we expect massive number of computing devices and software
entities are forming massive number of networks in a very dynamic fashion, we expect
other service delivery technologies such as Jini and Jxta could be quite useful.
Communication Patterns
This slide shows the communicating pattern in terms of number of tiers and
interaction among internal entities and external entities. As you can tell, until Web
services model, things are pretty much confined to intranet communication.
10/23/2005
Communication Patterns:
TM
Java 2
Business Systems
DB Server
App Server J2EE
Web Server
Browser J2SE/
Client J2ME
Web
Application
Now since the web application and web services models are two dominant
communication patterns, let's look into them in a bit more detail.
Here this slide shows web application communication model in which J2EE
architecture is made of web server, application server, and database server tiers while
J2SE and J2ME handles client tier.
10/23/2005
Bus.
Bus.
Sys.
Sys. XML
XML
DB
DB (UDDI,
(UDDI,
SOAP)
SOAP)
App
App J2EE
J2EE
Web
Web
J2SE/
J2SE/
Browser
Browser J2ME
J2ME
Context
Context and
and Identity
Identity
(LDAP,
(LDAP, Policy,
Policy, Liberty)
Liberty)
Web
Service
What is
Web Services?
14
14
10/23/2005
Let me define what web service is first since web service is becoming one
of those overly overloaded buzzwords these days. W3C recently has come
up with a decent definition of web services. According to W3C, “A Web
service is a software application identified by a URI, whose interfaces and
binding are capable of being defined, described and discovered by XML
artifacts and supports direct interactions with other software applications
using XML based messages via internet-based protocols.
15
10/23/2005
In the beginning, things were built and deployed typically in the form of
client and server model in which clients talk to a single server, for
example, doing remote procedure calls.
Finally, the web services model. As we will see in the following slides,
under web services model, service users and service providers can be
dynamically connected. And the pretty much every computing device and
application participate as both service user and service provider.
16
10/23/2005
17
Now let's compare traditional RPC which is the typical communication model used in
the first generation distributed computing technology we just saw against Web services.
First, traditional RPC is typically used within an enterprise while the real value of web
services is to enable enterprise to enterprise communication in an ad-hoc manner over
the internet.
RPC is typically tied up with a particular transport protocol while under Web services
model, multiple transports can be easily supported because any transport protocol that
can transport XML message can be used.
You will hear a lot about "loosely-coupled" nature of Web services. Because, the only
contract that have to be agreed upon between communicating parties under Web
services is the syntax and semantics of XML messages, in other words, there is no need
to agree on anything else. For example, there is no need to agree on object model, there
is no need to agree on programming language, there is no need to agree on
programming APIs. This is why we call Web services "loosely-coupled".
17
10/23/2005
18
Just to give you a sense on the differences between Web application which
is the second generation distributed computing we saw and web service
model.
Also under web application model, things are pretty much in static mode.
That is, in order to integrate various applications, you have to statically
configure them to talk each other. Under web services model, things could
be a lot more dynamic, that is, service users will find service provider
and use the services of those providers more dynamically.
Also under Web services model, services can be aggregated again in a ad-
hoc and dynamic fashion.
18
10/23/2005
Characteristics of Web
Services
? XML based everywhere
? Message-based
? Programming language independent
? Could be dynamically located
? Could be dynamically assembled or
aggregated
? Accessed over the internet
? Loosely coupled
? Based on industry standards
19
Because the only contract that have to be agreed upon between service user
and service provider is syntax and semantics of XML messages, as long as
valid messages can be generated and understood, it does not matter what
programming language is used. So Web service is said to be programming
language independent.
Web services can be dynamically located and invoked. And typically they
will be accessed and invoked over both internet and intranet.
We talked about the loosely-coupled nature of Web service already.
And all these will be based on de facto and de jure industry standards such
as SOAP, WSDL,UDDI and ebXML.
19
10/23/2005
This is the high level web services architecture. The cloud at the top right
hand side, the service grid, is a set of web services on the internet. These
services are accessible to the various client devices shown at the bottom
of the picture.
Once an appropriate web service has been located, the client then invokes
the web service, which delivers the service to the client.
20
10/23/2005
Service Assembly
Macro
Service Micro
Service
Business
Process
Management
Micro
Service
Micro
Service
21
21
10/23/2005
Service Nasdaq
Aggregation Input: Symbol
Output: Price
News feed 1
Stock Service Input: Symbol
Output: News links
Portal
User Input: Symbol
Output: Price, News,
Trade
News feed n
Input: Symbol
Output: News links
Brokerage 1 Brokerage n
Input: Symbol, Price, Input: Symbol, Price,
Qty Qty
22
22
10/23/2005
23
23
10/23/2005
24
24
10/23/2005
25
10/23/2005
XML
XML
Manufacturing
Supplier Internet Facility
XML
XML
Logistics
Now let's talk about motivation of Web services a bit from real-life example point of view.
That is, what is the value proposition of Web services? I would like to explain this by
giving you an e-commerce example.
One great opportunity and at the same time great challenge in e-commerce is to allow
business entities to perform business transactions over the internet without having to invest
a lot of resource in their IT infrastructure and without a lot of pre-arrangement with their
communicating partners. For example, suppose I am in the retail business in the United
States, and as a retailer, I would like to work with any potential supplier or distributor in the
world. And I would like to change my supplier as often as needed and whenever there is a
business requirement for the change. And that means my information system needs to be
able to talk to the system of my potential supplier without that much of pre-arrangement
and pre-agreement on programming language or middleware or platform.
What it means is that there is a growing need for standard lightweight infrastructure for
business data exchange.
Now everybody seems to agree that XML and messaging based business transaction will
address these needs. XML messaging based business communication is lightweight
because the only agreement between communicating parties is commonly agreed-upon
XML business messages. Of couse, you will need a lot more than that. But commonly
agreed-upon XML-based business messages will these previously isolated business
organizations to be able to communicate. And that is basically what web services is all
bout. It provides lightweight infrastructure for business to communicate through exchange
of XML messages.
26
10/23/2005
Application
A Computer
The Network
27
27
10/23/2005
Insurance
Portfolio Cash Value
Stock ticker
Biz News
“Portfolio” can be an News
application, a portal
channel, or a web World News
service itself 28
Web services are accessed programmatically, not by a human user directly. In the
case of an online broker, the user can surf the HTML pages regarding the purchase
of a stock, such as finding stock symbol, finding price, entering number of shares
requested, confirming the purchase request, getting a confirmation number, etc.
But it would be very difficult to write a program to access these pages. HTML is
hard to parse and the website might change the contents and organization of its
pages on a daily basis. If the broker offered a stock-buying web service, the
program to access it is simple—send an XML message over the SOAP RPC and
get and XML message back. You could write a simple Perl script or Visual Basic
program to accomplish this.
Web services are well-defined, modular services that perform a specific task, but
can be interlinked together to provide a larger set of services. This example shows
how a Portfolio application can be developed out of web services assembled from
all over the Internet. As noted, Portfolio could be a desktop or server application, a
channel in the Portal Server desktop, or it could be a web service itself, ready for
assembly into an even larger service or application.
Side note: Today you can develop components following the J2EE model, such as
with EJBs. Thus, this concept can be achieved today with Sun ONE. More
importantly it should be noted Java and web services are complementary. You
need to write the code to implement each micro service in some language. The
industry has accepted the standard of writing enterprise applications using the
J2EE model.
28
10/23/2005
Thesaurus
Word Processing
Media
“Word processing” c:\...
can be an Publishing
application, a
capability, or a web http://...
service itself 29
29
10/23/2005
30
30
10/23/2005
Impact on Integration:
Trigger the Network Effect
Custom
Integration Web Services
Another impact of web services is that they will trigger the Network Effect
for integration technology.
31
10/23/2005
32
32
10/23/2005
33
33
10/23/2005
Where is &
Where is Web Services
going?
34
34
10/23/2005
Just like any other new technology that promises a brand new world, Web services comes
with its own set of confusion and myths. So let's clarify some of those myths here.
First myth is that web services is going to cure cancer. I can promise you with 100%
certainty that it will not... at least for a very very long time and it will not make all your
issues you have to be concerned about when writing good quality applications go away. You
still have to write good software that works. Also Web services, despite its promising future,
still have to prove itself in the real world.
Another myth people might have is that Web services is something completely new. That is
not true either. Distributing computing has been around for quite a while in which remote
service can be invoked over the wire. As for service definition, people used to use IDL to
define service definitions. As for service publication and discovery, there is also directory
service like LDAP. What is unique about Web service, however, is that now everybody
agrees on a common XML-based standards on service description, service invocation, and
service publication and discovery.
Another myth is that you have to write Web services from scratch. That is not true at all. In
fact, as I will talk about later on, Web services happened to be just another delivery channel
of your service. And the service implementation you currently have can be exposed as web
services without any modification.
Lastly, a myth about J2EE and web service. Web services model can be easily added to J2EE
platform without any change to the existing architecture. In fact, existing J2EE components
such as EJB's can be easily exposed as Web services. And as we will talk more about this
later on, this is one of the significant differences between SunONE and .Net in that in Sun
ONE architecture, the investment you made can be preserved when you are moving toward 35
Web services model.
10/23/2005
36
10/23/2005
37
10/23/2005
First, let me tell you this up front, J2EE community incuding Sun microsystems
strongly believe in the vision and promise of web services. Now we believe
web services will be adopted in phases.
First phase is where simple web services are used in consumer oriented settings
typically for the purpose of simple consumer-oriented transaction.
In the second phase, we believe that web services could be used for enterprise
application integration, EAI in short, within an intranet. And in fact many
organizations have started looking at Web services as one way of doing EAI.
And we believe this phase has already begun.
The 3rd phase could be dubbed as business web services where business
organizations are performing business transactions with their trading partners,
suppliers, or even customers through the exchange of XML-based business
messsages over the internet.
38
10/23/2005
Even though we believe simple web services and EAI are important forms of web
services, we also believe the real value of web services lies with business web
services. That is the reason why we are investing quite a bit of our engineering
resources to key technologies that will enable business web services.
Second, we firmly believe ebXML and UBL (Universal Business Language) provide
viable and only open-standards based business web services framework. And II want
to say it loud and clear. ebXML is real and in fact there are more than 16 commercial
vendors and open source-based products that support ebXML right now including Sun
Microsystems's Secure Trading Agent. In fact, real life customers are using ebXML
right now for solving real-life problems. For example, austrailian energy industry is
using ebXML mesasging service for secure and reliable XML message delivery. And
we believe ebXML adoption will accerlate during the next year or so.
39
10/23/2005
40
40
10/23/2005
S
10/23/2005
43
10/23/2005
? Service Description
? Service Registration (Publication) and
Discovery
? Service Invocation
44
44
10/23/2005
45
45
10/23/2005
Registry
2. Client Request
1. Service Registers Service Location
PUBLISH FIND
3. Client calls
Service
Web Service
BIND
Service Client
46
46
10/23/2005
SOAP
(Simple Object
Access Protocol)
47
47
10/23/2005
SOAP
? Simple Object Access Protocol
? Wire protocol similar to
– IIOP for CORBA
– JRMP for RMI
? XML is used for data encoding
– “text” based protocol vs. “binary” protocol
? Supports XML-based RPC
48
As a wire protocol, it defines data encoding. In other words, it specifies rules of how
data types get serialized over the wire. For example, it specifies how integer value 23
or string value xyz are to be represented on the wire. Defining standard encoding rules
is important for interoperability, if you think about it, because without the agreed-upon
encoding rules, communicating partners would not be able to understand the data that
gets delivered on the wire. (For example, the communiting partners have to agree on
whether integer value 23 is going to be represented in 2 bytes or a single byte and in
what form.) The difference between SOAP encoding and others is that under SOAP,
the encoded data are in XML representation, which is text based encoding while others
are in binary encoding.
SOAP also supports remote procedure call mechanism which is used to invoke a
procedure call on a remote machine again the using XML notation.
48
10/23/2005
Now, I would like to make sure you understand what SOAP is not as well because there
seems to be some confusion about this.
First, SOAP is not a component model. So it will not replace existing component models
such as Javabeans or EJB. In fact, component models and SOAP are very complementary
in that SOAP can be used as communication protocol for invoking business logics that
are captured in those components.
Second, SOAP is not a programming language. That is, it will not replace programming
language like Java. In fact, SOAP and Java are very complementary as well. That is, Java
is for portable code and SOAP is in a sense a portable communication protocol.
Now, if you think about it, SOAP messages have to be produced and processed and
manipulated by a programming language. What is the programming language of choice
for SOAP message production, manipulation, and processing? It is Java. In fact, most of
the SOAP packages out there are written in Java.
Third, SOAP is not an answer for all problems in distributed computing. In many cases,
tightly-coupled and non-XML based technology such as RMI is in fact a better solution,
for example when you need to build high-performance and secure intranet applications.
49
10/23/2005
50
What are the things that SOAP define as communication protocol? The
SOAP specification covers four aspects: Message envelope, Encoding
rules, and remote procedure call convention, and finally how to bind SOAP
message with underlying transport protocol such as HTTP. Now let's take
a look at each of these in detail.
50
10/23/2005
SOAP Header
Primary MIME part
Header Entry
(text/xml)
Header Entry
Attachment
SOAP Body
Attachment
Body Entry
Body Entry
Attachment
51
This picture shows the format of SOAP message, actually SOAP message
with attachments.
51
10/23/2005
We will see an example of SOAP message soon but the header is optional
and it can contain so called context knowledge such as security or
transaction related information while the body contains application data or
remote procedure call method and it parameter information.
Please note that the SOAP specification does not specify any of these
contexts. But SOAP header structure can be extensible, and that is how
ebXML messaging service provides security and reliability by defining
elements that can be embedded in the header structure. And we will see an
example later on.
52
10/23/2005
SOAP Encoding
• Rules of expressing application-defined
data types in XML
• Based on W3C XML Schema
• Simple values
– Built-in types from XML Schema, Part 2 (simple
types, enumerations, arrays of bytes)
• Compound values
– Structs, arrays, complex types
53
SOAP encoding supports both simple values and compound values. Simple values
are the values of of built-in types from XML schema part 2 or enumeration or byte
array.
53
10/23/2005
Now let's talk about SOAP RPC. This is a very simple example of SOAP
RPC message. As you can see here, the SOAP message envelope contains
namespace information and could contain encoding information as
attributes of Envelope element.
It contains optional SOAP header which could contain context
information.
Then it contains SOAP body part which contains a single method with its
parameters. And in this case, the method is GetLastTradePrice with a
single parameter SUNW whose type is tickerSymbol.
54
10/23/2005
And this is the response to the previous request. In this example, the body
contains GetLastTradePriceResponse and price elements.
55
10/23/2005
SOAP RPC
? Information needed for a method call:
– The URI of the target object
<SOAP-ENV:Body>
<m:GetLastTradePrice
xmlns:m=“http://stocks.com/StockQuotes" >
<tickerSymbol>SUNW</tickerSymbol>
</m:GetLastTradePrice>
</SOAP-ENV:Body>
56
Just to recap what you need to construct SOAP RPC message. First you
need to specify the URI of the target object as name space attribute of the
method element. Target object is the destination to which you are sending
the SOAP message.
56
10/23/2005
SOAP RPC
? Information needed for a method call:
– The URI of the target object
– Method name
<SOAP-ENV:Body>
<m:GetLastTradePrice
xmlns:m=“http://stocks.com/StockQuotes" >
<tickerSymbol>SUNW</tickerSymbol>
</m:GetLastTradePrice>
</SOAP-ENV:Body>
57
57
10/23/2005
SOAP RPC
? Information needed for a method call:
– The URI of the target object
– Method name
– Parameters
<SOAP-ENV:Body>
<m:GetLastTradePrice
xmlns:m=“http://stocks.com/StockQuotes" >
<tickerSymbol>SUNW</tickerSymbol>
</m:GetLastTradePrice>
</SOAP-ENV:Body>
58
Finally, you have to specify parameters that go with the method. In this
case, there is only one parameter, SUNW, whose type is tickerSymbol.
58
10/23/2005
59
Now since we talked about the web services architecture over J2EE, let's
go over the steps needed for developing web services over J2EE.
59
10/23/2005
What is WSDL?
• XML language for describing web services
• Web service is described as
– A set of communication endpoints (ports)
• Endpoint is made of two parts
– Abstract definitions of operations and messages
– Concrete binding to networking protocol (and
corresponding endpoint address) and message format
• Why this separation?
– Enhance reusability (as we will see in UDDI reference
to WSDL document)
60
An endpoint is made of two parts: The first part is abstract definitions of operations
and messages. As you will see later on, operations and messages are related in that
messages are exchanged for the purpose of performing the operations. The 2nd part is
concrete binding of those abstract definitions of operations to concrete network
protocol and message format. And one concrete example of network protocol is
SOAP over HTTP.
The whole idea of this separation of abstract definitions from concrete binding is to
allow the reuse of abstraction definitions regardless of present or future network
protocols.
60
10/23/2005
Why WSDL?
• Enables automation of communication details
between communicating partners
– Machines can read WSDL
– Machines can invoke a service defined in WSDL
• Discoverable through registry
• Arbitration
– 3rd party can verify if communication conforms to
WSDL
61
61
10/23/2005
62
The request takes a ticker symbol of type string and the response returns
price whose type is float.
As you will see, WSDL XML vocabularies define 7 XML elements.
62
10/23/2005
WSDL Elements
? Types
? Message
? Operation
? Port Type
? Binding
? Port
? Service
63
63
10/23/2005
WSDL Elements
? Types
– Data type definitions
– Used to describe exchanged messages
– Uses W3C XML Schema as canonical type
system
64
64
10/23/2005
By the way, this WSDL document that I am going to show you in several
slides is a complete WSDL document.
First, it defines several XML namespaces.
The types element in this example define two data types whose names
happened to be TradePriceRequest and TradePrice. TradePriceRequest
defines tickerSymbol which is a string type and TradePrice defines price
which is float type.
And as you will see later on, these data types, TradePriceRequest and
TradePrice will be used to describe messages.
65
10/23/2005
WSDL Elements
? Messages
– Abstract, typed definitions of data being
exchanged
? Operations
– Abstract description of an action
– Refers to an input and/or output messages
? Port type
– Collection of operations
– Abstract definition of a service
66
66
10/23/2005
Example:
Messages, Operation, Port type
<message name="GetLastTradePriceInput">
<part name="body" element="xsd1:TradePriceRequest"/>
</message>
<message name="GetLastTradePriceOutput">
<part name="body" element="xsd1:TradePrice"/>
</message>
<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput" />
<output message="tns:GetLastTradePriceOutput"/>
</operation>
<!-- More operations -->
</portType>
67
In this example, two messages are defined - the first one is called
GetLastTradePriceInput and the other one is called GetLastTradePriceOutput. As you
can tell, these are request and response messages of stock quote service. Now please
note that message definitions refer to the data types we just defined, TradePriceRequest
and TradePrice.
Now I said portType is just a collection of operations. In this example, we have only
one operation. What is an operation? As I said in previous slide, it is an action, and an
action is made of input and/or output messages we just defined using message
elements. So in this example, the GetLastTradePrice operation will be performed as a
combination of input message, GetLastTradePriceInout, and output message,
GetLastTradePriceOutput message.
Please note that here there is no mentioning on which XML protocol or transport will be
used. This is why we call these elements as abstract definitions. And obviously they
have to be bound to a concrete XML and transport protocol. And that is what we are
going to see in the next slide.
67
10/23/2005
WSDL Elements
? Binding
– Concrete protocol and data format for a particular
Port type
– Protocol example: SOAP 1.1 over HTTP or SOAP 1.1
over SMTP
? Port
– Defines a single communication endpoint
– Endpoint address for binding
– URL for HTTP, email address for SMTP
? Service
– Aggregate set of related ports 68
68
10/23/2005
69
And the data format of the operation named GetLastTradePrice will use
literal.
69
10/23/2005
UDDI
70
Now since we talked about the web services architecture over J2EE, let's
go over the steps needed for developing web services over J2EE.
70
10/23/2005
Service Architecture
UDDI
Registry
2. Client Request
1. Service Registers Service Location
PUBLISH FIND
Web Service
3. Client calls Client
Service Service
BIND
71
10/23/2005
72
10/23/2005
Other
Web Services
Standards
73
Now since we talked about the web services architecture over J2EE, let's
go over the steps needed for developing web services over J2EE.
73
10/23/2005
ebXML
74
10/23/2005
75
75
10/23/2005
76
76
10/23/2005
Java APIs
for Web Services
77
77
10/23/2005
78
First, Java APIs for SOAP, WSDL, UDDI. For SOAP messaging, we have JAXM,
SAAJ, JAX-RPC, and even JMS.
For WSDL, we have Java API for WSDL for creating, manipulating, querying
WSDL documents. This API is expected to be used by tool vendors. The more
important API for developers is JAX-RPC.
78
10/23/2005
79
For electronic business framework. JAXM with ebXML message service profile
will let you perform service invocation with higher level of security and
reliability.
79
10/23/2005
80
This slide is here for the sake of completeness. Since we already talked
about these, I will not talk about them here again.
80
10/23/2005
There are also Java APIs for XML document management, JAXP for parsing and
transformation of XML documents and JAXB for XML data binding.
The way I explain the difference between JAXP and JAXB is that JAXP is like
assembly language of XML document management because you have to create
yourself the Java objects from the parsed XML document while JAXB is like high-
level language like Java since from XML schema you can create corresponding Java
class.
Now there is another JSR effort which got just started. And that is JSR 173, the
Streaming API for XML (StAX) parsing. It will specify a Java-based, pull-parsing
API for XML. The streaming API gives parsing control to the programmer by
exposing a simple iterator based API. This allows the programmer to ask for the next
event (pull the event) and allows state to be stored in a procedural fashion. Two
recently proposed JSRs, JAXB and JAX-RPC, highlight the need for an XML
Streaming API. Both data binding and remote procedure calling (RPC) (need better
statement here.). A streaming API makes this type of code much more natural to write
than SAX, and much more efficient than DOM.
81
10/23/2005
82
Also there are Java community efforts defining APIs for XML-based
security schemes.
First, Java API for XML digital signature for authentication, non-
repudiation, and tamper-proofing. And XML encryption is for
confidentiality. XML trust service is for XML-based PKI system
mainly based on XKMS (Extensible Key Management Specification).
JSR 155 defines standards Java APIs for SAML, Secure Assertion
Markup Language. A newly started JSR defines Java APIs for WS-
Security effort of OASIS.
82
10/23/2005
83
Now there are even more Java API initiatives going on.
JSR 156 defines standard Java APIs for XML based transactioning.
This is based on BTP, Business Transaction Protocol effort going on
in OASIS.
The web services metadata for J2EE effort will enable the metadata
based web services development and deployment over J2EE, which
will be leveraged by tool vendors. The idea is to allow developers to
specify web services functionality in metadata instead of being forced
to do web services programming.
83
10/23/2005
84
84
10/23/2005
Existing
Applications
B2C
Applications
Web
Services
Application Server
Wireless Enterprise
Applications Information
Systems
85
85
10/23/2005
Now, let's talk about the motivation for using J2EE as development and deployment
platform for web services.
As most of you already know, J2EE is an open standard platform for building enterprise
applications in which business logic are captured and deployed as components. J2EE is also
an end-to-end architecture where there are multiple programming models to implement and
deploy these business logics. That is, there is servlet, there is JSP, there are EJB beans, and
there is JMS. All these programming models provide somewhat different ways of
implementing and deploying business logics over J2EE and you as developers choose one
ore more of these programming models according to the needs and requirements of your
applications.
Now if you think about it, web services model is just another way of exposing the business
logic of these components. There is no architectural or code change required to expose the
existing J2EE components as web services . For example, as a service provider, in addition
to exposing business functions captured in EJB beans by EJB remote interface over
RMI/IIOP, you can also expose them via WSDL and handle the service by receiving SOAP
message and send the result back in SOAP messages.
What it means is that the existing J2EE components can be exposed as web services without
any change in their code which also means the key benefits of J2EE such as open and
standard platform, portability of code, availability of highly scalable and highly reliable
platform products, are still preserved. And most of all, you can still choose the best of breed
J2EE platform or J2EE applications including web services components without
compromising the code portability.
86
10/23/2005
J2EE has proved itself as the platform of choice for building enterprise applications.
Now what about web services? Where are we now and where are we going in terms of
using J2EE as Web services platform?
As many of you already know, Java community is feverishly working on defining Java
APIs for web services. And THE primary platform that these Java APIs are designed
for is J2EE.
Tool vendors already have products out there that you can use to expose existing J2EE
components such as EJBs as web services by basically providing a tool that can
generate WSDL document from EJB beans and from the WSDL, a client stub can be
generated which knows how to send and receive SOAP messages in order to use the
service defined in WSDL. So you can expose business functions that you already have
in J2EE as web services right now.
Finally J2EE community is in the works to define overall Web services framework for
J2EE through J2EE 1.4 and JSR 109 for the sake of portability of Web services.
87
10/23/2005
88
88
10/23/2005
89
89
10/23/2005
? EJB 2.1
– Defines Stateless Session Bean-based Web services
endpoint model
? Servlet 2.4
– Will be aligned with JAX-RPC
? JSR 109
– Defines standard Web services packaging and
deployment model
90
90
10/23/2005
91
Now let's talk about Web services architecture over J2EE in a bit more
detail.
91
10/23/2005
92
10/23/2005
93
Now I would like to talk about component and container model of J2EE and how it
relates to web services.
One of the key architectural characteristics of J2ee is that business logic are
implemented as components, which are in turn executed in a host execution
environment called containers. And this container and component model will be
used for implementing and deploying web services as well. That is, you will build
web services as components which will be then executed in a web service container.
In other words, web services components are going to be a 1st-class citizen of
J2EE along with servlet, JSP and EJB.
(add more speaker notes)
93
10/23/2005
This picture shows what I just explained in the previous slide. Web
services components can reside either at web-tier or EJB-tier. When web
services component is built as a servlet-based endpoint, it is running
within the web container while when it is built as a session bean based
endpoint, it will be running within the EJb container. So you can see we
are leveraging existing container architecture for Web services
components.
94
10/23/2005
Java Technology-based
Web Services Tools
95
95
10/23/2005
You can be also assured that leading IDE vendors will provide Java-based
web service modules that are well-integrated with their existing
development environments.
96
10/23/2005
J2EE 1.4
? Focus is Web services
– Umbrella JSR for all Java APIs for Web services
?
JSR 109, JAX-RPC, JAXR, EJB 2.1
– Web services framework for J2EE
– J2EE component model, deployment,
packaging, and container requirements
? Released in Nov. 2003
– http://java.sun.com/j2ee/1.4/download-
dr.html
97
97
10/23/2005
98
98
10/23/2005
Summary
99
99
10/23/2005
Summary
? Web services provides a new paradigm for
program to program communication
? Comprehensive set of Java APIs for Web
Services are now available!
? J2EE is the platform of choice for Web services
100
Sun ONE is open framework for service on demand paradigm and web
services is part of it.
And finally J2EE is the platform of choice for web services development
and deployment.
One last thing I would like emphasize is that we believe the real value of
web services is in the area of business web services not in the things you
see right now like temperature convertor or traffic report. And that is the
area we will put lots of our resources.
100
10/23/2005
Passion!
101
101