Transcript Link Lab 6

Chapter 5. Web Services
1. Introduction
2. Web Service Infrastructure
1
1. Introduction
B2B Integration
Manual Integration Between Companies
B2B interactions
occur by accessing
Web pages, filling
Web forms, or via
email.
Traditional web-enabled applications
are primarily focused on presentation
and are unable to interact with other
applications.
The main reason is that they are built
using different web technologies,
and their access is limited through
an Internet browser or by using an
application-specific client.
warehouse
2
Web Service Paradigm
Web Service Overview
Web service addresses the challenges faced by traditional systems for B2B integration
by bringing a set of new features.
• Service-Oriented Architecture
• Functionality always exposed as services
• Loosely coupled
• Invoked by programs as well as users
• Redesign of middleware protocols
• Peer-to-Peer
• Between trust domains
• Compatibility with Internet
• Standardization
•Web standards
3
Web Service Overview (ctd.)
Web services introduce a new paradigm for enabling the exchange of information across
the Internet using a wide range of computing platforms, based on the use of open Internet
standards and technologies.
Web services are self-describing and modular business applications that expose the
business logic as services over the Internet through programmable interfaces and using
standard Internet protocols.
As such they can be defined as “loosely coupled software components delivered over
Internet standard technologies”.
Based on XML standards, web services can achieve interoperability of applications based
on different programming languages and platforms.
This facilitates the delivery of business applications as a service accessible to anyone,
anytime, at any location, and using any platform.
4
2. Web Service Infrastructure
Basic Web Service Infrastructure
Using SOAP
 SOAP: XML-based Messaging protocol for exchanging information between the
service provider and service requester.
To approximate, this is just RPC using XML to encode messages (SOAP) and HTTP to
transport them.
5
Using WSDL Specification
XML schema-based specification for describing Web services as a collection of operations
and data input/output parameters as messages.
Defines the communication model with a binding mechanism to attach any transport
protocol, data format, or structure to an abstract message or operation.
Note: all WSDL
“processing”
happens at
Development
time.
6
Using UDDI Registry
A mechanism to register and categorize Web services in a registry that users communicate to
in order to discover and locate registered services.
 A query submitted to the UDDI returns the WSDL description of the service interface. The
developer can use this description to construct a SOAP client interface that can communicate
with the service provider.
Again, this is
just RPC with a
Directory
7
Simple Object Access Protocol
• Specifies:
• message format for one-way communication
• specification for SOAP RPC
• rules for processing SOAP messages
• rules for transport - HTTP and SMTP
A SOAP Message
-Consists of the following:
 SOAP Envelope: specifies two things: an XML
namespace and an encoding style.
SOAP header: used to indicate some additional
processing at an intermediate node, that is, processing
independent of the processing done at the final
destination.
SOAP body: contains the main part of the SOAP
message, i.e., the part intended for the final recipient of
the SOAP message.
8
SOAP Message-Example
9
SOAP Communications: Document vs. RPC
-SOAP allows Web services communications using either RPC-based synchronous or
messaging-based asynchronous communication models.
10
SOAP over HTTP
-A SOAP message is transported through the network
using an existing Internet protocol
-HTTP is typically used, although other
protocols, e.g., SMTP can be used
-The specification of which protocol
to use is called a binding.
-In addition of specifying the transport mechanism, SOAP bindings also describe implicitly the address
of the ultimate SOAP message receiver, e.g., the URL in the case of HTTP and “to” address for SMTP
11
Simple Implementation of SOAP
12
Example: Flow of web service call using J2EE
Service
Implementation
on J2EE
Platform
Java
Client
Java Call
Parameters
1. Maps Java to
XML
2. Form SOAP
Message
1. Outgoing
SOAP Handler
Actions
Return Values
1. Maps XML to
Java
2. Disassemble
SOAP Message
1. Incoming
SOAP Handler
Actions
1. Maps Java to
XML
2. Form SOAP
Message
1. Outgoing
SOAP Handler
Actions
2. Container
services
Java Call
Parameters
1. Maps XML
to Java
2.
Disassemble
SOAP
Message
1. Incoming
SOAP
Handler
Actions
2. Container
services
Web
Service
Port
JAX-RPC
Client Side
Runtime
SOAP Message
Return Values
Internet
JAX-RPC
Runtime in a
J2EE
Container
13
WSDL Specifications
XML schema-based specification for describing Web services as a collection of operations
and data input/output parameters as messages.
Consist of:
• Abstract part
• signatures, operations
• like traditional IDL
• Concrete part
• bindings/services/ ports
Concrete Part
• Interface Bindings
• message encoding &
protocol bindings
• Ports
• interface binding &
network address
• Services
• logical groupings of
ports
14
A WSDL Service Specification
15
Automatic Generation of WSDL
16
Universal Description Discovery and Integration
A mechanism to register and categorize Web services in a registry that users
communicate to in order to discover and locate registered services.
Specifically:
• Service Registry
• for browsing by developers
• for dynamic binding
• Business registry
• original goal: global registry, every business and exported service registered there
• now: support interaction between private and public UDDI registries
17
Information in UDDI
• Business entity
• an organization that provides
Web services
• Business Service
• group of Web Services that
cooperate in performing some
business process
• bindingTemplate
• technical information needed
to use the service
• tModel
• general container for a specification
Stored in the UDDI registry
18
Model Description and Sharing
19