Web Services
Download
Report
Transcript Web Services
Review
V. “Juggy” Jagannathan
Associate Professor of Computer Science
West Virginia University
1
Focus of Global Knowledge
Networks
Enterprise
Application Development
Distributed Systems Development
Component-based Solution
Development
Knowledge-based Solution
Development
2
ASP & Enterprise Applications
Application Service Provider (ASP) provides
applications to customers on a
subscription basis. ASPs provide for all
the infrastructure needs to host the
application and rely on Internet or
Intranets to deliver the applications to
customers.
ASPs are Enterprise Applications and need
to satisfy a wide range of stringent
requirements.
3
Enterprise Application
Requirements
Flexibility
Security
Reliability
Availability
Scalability
Evolvability
Performance
Supportability
Maintainability
Interoperability
Platform Independence
Location Independence
Open Standards and Systems
Architectural Choices
4
Platform Choices
Platform Standards
– Object Management Group (OMG)
CORBA Infrastructure and approach
– Web services – the new kid on the
block
Other Popular Platforms
– Sun J2EE Platform
– Windows .NET
Host of other vendor platforms
– Oracle
– IBM
– Iona
5
CORBA Architecture –
Simple view
Servers
Server
Clients
C++ Java Ada C
other
C++ Java Ada C
Client Requests
IDL-based
other
Service
IDL-based
ORB
6
Java and J2EE
Platform
Overview
7
J2EE Architecture
XHTML
XML
Mail Server
RDBMS
HTTP(S)
Java App.
CORBA Server
Web Container
Applet
Servlets
JSPs
JAF
JavaMail
JMS
JDBC
JTA
JNDI
RMI/IIOP
J2EE
Application
Server
EJB Container
Session
Entity
Beans
Beans
Directory
Service
Message Queue
JAF
JavaMail
JMS
JDBC
JTA
JNDI
RMI/IIOP
Client
App.
Tag
Library
8
Reproduced with Permission from Java Server Programming J2EE Edition – Wrox Press, Ltd, 2000
J2EE Platform Components
JAXP 1.0 – Java API
for XML Processing
JDBC 3.0 – Java Data
Base Connectivity
RMI over IIOP
EJB 2.1 – Enterprise
Java Beans
Java Servlets 2.4
Java Server Pages 2.0
Java Message Service
1.0
Java Naming and
Directory Interface
(JNDI) 1.2
Java Transaction API
1.0
JavaMail 1.1 J2EE
Connector
Architecture 1.0
Java Authentication
and Authorization
Service 1.0
9
J2EE Platform
Strong
and proven platform
Evolving constantly
Already supports various APIs
to develop and deploy web
services
10
.NET Platform
Client App.
Users
.NET Framework
Web
Services
.NET
DCOM
ODBC
UDDI
SOAP
HTTP
Web
servers
Web
Webservers
servers
Web
Forms
Web
servers
Web
servers
.NET
servers
11
.NET Components
.NET framework
– Common Language Runtime (CLR)
library
– ActiveX Data Objects - (ADO.NET)
– Active Server Pages – (ASP.NET) and
supports Web Services (UDDI, WSDL &
SOAP)
– .NET Compact framework for PDAs
– .NET Remoting (RPC support)
Visual Studio .NET
– VB, C++, C#, Jscript… all compile to
MSIL (Microsoft Intermediate
Language) and utilize CLR.
12
.NET Framework
Microsoft’s big push to open
standards and support for XMLbased solutions
Fully supports web services
approach
Microsoft is an active participant in
W3C efforts and is a strong
proponent of standardization of web
services and related technologies.
13
XML Technology
Overview
14
Emerging Importance of XML
Why do we care about XML?
HTML-tagging is display oriented.
XML-based content tagging has important uses:
–
–
–
data mining
role-oriented display customization
intelligent searching and other value added elements
–
–
–
Microsoft
Netscape
W3C is pushing the standardization efforts
Wide spread industry support for this new open
standard
Complementary technology to HTML-based web
browsers
15
Requirements best addressed by XML ?
Customizing front-end applications easy presentation of what users want
to see
Data mining
Synthesis type applications combining multiple information
sources
Electronic commerce-type
applications
Structured Data Exchange
16
XML Markup
Elements
and attributes
Entity References
Comments
Processing Instructions
Marked Sections
Document Type Definitions
(DTDs)
Now, XML Schemas
17
Elements
Bounded
by start and end tags
Sample markup
<Patient>
<FirstName> Frank</FirstName>
<LastName> Foster</LastName>
</Patient>
Patient,
LastName, FirstName
are all entity tags.
18
Attributes
Name-value pairs included as part of
start tags.
Sample markup
<APatient patientID=“123” FirstName=“Frank”
LastName=“Foster”>
<Insurance> Blue Cross </Insurance>
<Insurance> HMO </Insurance>
</APatient>
FirstName and LastName in the
example above are attribute
declarations.
19
Document Type Definitions
Allows
the expression of
constraints on tags
Defines sequencing and nesting
of tags
Defines attributes and values
and defaults
Allows specification of external
file references
20
XML Schemas
Replaces
DTDs
Is in XML format (DTD’s are
not)
Supports data typing (DTD’s
didn't)
Schemas are extensible
XML Schemas – next
generation of DTDs.
Wide industry support
21
XML’s evolving family of standards
XML Linking Specification (XLL)
Resource Directory Framework (RDF)
Style sheets
– CSS Cascading Style sheets
– XSL - XML Style sheet Specification
Language
Document Object Model (DOM)
XML Schemas
Provides the basis for Web Services
and Simple Object Access Protocol
(SOAP)
22
Web Services
23
Web Service Definition
A Web service is a software system
designed to support interoperable
machine-to-machine interaction over a
network. It has an interface described in a
machine- processable format (specifically
WSDL). Other systems interact with the
Web service in a manner prescribed by its
description using SOAP messages,
typically conveyed using HTTP with an
XML serialization in conjunction with other
Web-related standards.
Source: W3C definition:
http://www.w3.org/TR/2004/NOTE-ws-arch-20040211/
24
What are XML Web Services?
Interaction
using standard
internet protocols
A vehicle used to integrate
other applications
Expose functionality through
well-defined interfaces
Can be advertised in a
registry/directory.
25
Web Services Architecture
http://www.w3.org/TR/2004/NOTE-
ws-arch-20040211/
26
Different Models supported by Web
Services
Message
Oriented Model
Service Oriented Model
Resource Oriented Model
Policy Model
27
Example XML Web Services?
Information
services
Centralization services
Data Integration,
Aggregation and Analysis
Extending and Integrating
Applications
Peer-and-Push-based
systems
28
Benefits of Web Services?
Standards
based
Vendor neutral
Simplicity
Language and Platform
Independence
Functional Abstraction
Discoverable
Reduced Development time
29
When not to use Web
Services?
Closed
systems
Critical Performance
requirements
Technical limitations – like
transaction support and
security elements have not
been standardized
30
Web Services Ensemble
Discovery
UDDI
Description
WSDL
Messaging
SOAP
Encoding
XML
Transport
HTTP
31
Web Services
Definition
Language
WSDL
32
What is WSDL?
Web Services Definition Language
It is equivalent of IDL for Web Services
It is in XML Schema format
It defines an EXTENSIBLE framework for
specifying web services interfaces
Developed originally by Microsoft and IBM
and now being put through its paces in
W3C.
W3C working on Version 1.2 of WSDL right
now (Fall 2003).
33
WSDL: What does it support?
Data type definitions
Messages supported
Operations supported
Port type (an aggregation of
messages and operations)
Binding (what protocol supports the
service – ala SOAP)
Port – target address where service
is available
Service – aggregation of port types
34
WSDL Service
Web Service
Port Type
Port TypePort Type
Operation
OperationOperation
Operation
OperationOperation
Operation
OperationOperation
Binding
Binding
Binding
BindingBinding
Binding
Binding
Binding Binding
WSDL
specifications are
published in a
URL.
Clients download
this specification,
pick a particular
protocol to
communicate
with the service
(binding) and use
that protocol.
35
SOAP...
It is a Simple Protocol that allows
you to Access an Object through
the net.
Courtesy: Yan Liu, my student.
36
SOAP Motivations
Heterogeneous systems must be able
to communicate
Binary protocols don’t always work
– CORBA, DCOM, etc. don’t work well through
firewalls
– Nobody can agree on a standard binary format
(usually due to platform-related issues)
– We’re dealing with many heterogeneous
environments (MVS, Unix, Windows NT, Linux,
PalmOS, etc.)
– Component runtimes differ
– Security models differ (Kerberos, NTLM, OSF-DCE)
Courtesy: Yan Liu, my student.
37
What SOAP is...
SOAP is a specification for defining...
– an encoding style that uses XML to
represent information graphs
– a standard way to move XML with HTTP
– rules for passing messages
– error (fault) definition
– a medium for performing Remote
Procedure Calls (RPC)
– one layer in a multi-layer architecture
Courtesy: Yan Liu, my student.
38
SOAP Contains Four Parts:
An extensible envelope expressing (mandatory)
– what features and services are represented in a
message;
– who should deal with them,
– whether they are optional or mandatory.
A set of encoding rules for data (optional)
– Exchange instances of application-defined data types
and directed graphs
– Uniform model for serializing abstract data models
that can not directly be expressed in XML schema
A Convention for representation RPC (optional)
– How to make calls and responses
A protocol binding to HTTP and HTTP-EF (optional)
Courtesy: Yan Liu, my student.
39
SOAP - Simple Example
<Envelope>
<Header>
<transId>1234</transId>
</Header>
<Body>
<Add>
c = Add(a, b)
<a>3</a>
<b>4</b>
</Add>
</Body>
</Envelope>
Courtesy: Yan Liu, my student.
40
System Flow (HTTP)
<Envelope>
<Header>
<transId>1234</transId>
</Header>
<Body>
<Add>
<a>3</a>
<b>4</b>
</Add>
</Body>
</Envelope>
<Envelope>
<Header>
Courtesy: Yan Liu, my student.
<transId>1234</transId>
</Header>
<Body>
<AddResponse>
<c>7</c>
</AddResponse>
</Body>
</Envelope>
41
SOAP – Example from
healthcare
Example Request
<soap:Envelope>
<header> …. </header>
<soap:Body>
<GetName>
<MR#>123456</MR#>
</GetName>
</soap:Body>
</soap:Envelope>
Example
Response
<soap:Envelope>
<header> …. </header>
<soap:Body>
<GetNameResponse>
<Name>John
Doe</Name>
</GetNameResponse>
</soap:Body>
</soap:Envelope>
42
SOAP Execution
Application
Web Service
Interface Semantics
Interface Semantics
Envelope/Header/Body
Envelope/Header/Body
Message Encoding
Message Encoding
Transport (e.g. HTTP)
TCP/IP
Transport (e.g. HTTP)
TCP/IP
Courtesy: Yan Liu, my student.
43
SOAP – Conclusions
Basis
for Web services
Significant component of
Microsoft’s .NET platform
Supported by everyone
Has a strong future
44
Universal
Description,
Discovery and
Integration
(UDDI)
45
UDDI – What is it?
A
vehicle to locate operational
web services
Similar to Domain Name
Service (DNS) lookup
Embodies the concepts of
“White Pages and Yellow
Pages”.
46
UDDI Elements
White
Pages: Business Name,
Contact Info, DUNS etc
Yellow Pages: Business
categories, key-value pairs of
relevant information
Green Pages: Technical
information on how to connect
to web services
47
UDDI Process Supported
Business registers its web service
(information that put in white,
yellow and green pages).
The information gets propagated to
all UDDI servers (replicated)
Customers contact known registries
Locate appropriate service and
invoke them.
Main protocol supported is SOAP.
48
Web Services Current Status
Evolving rapidly – strong support for
SOAP and WSDL has decent
support.
UDDI is little further away.
All vendors are incorporating various
components of Web services
Web services is the future – right
now people have to deal with other
component technologies
49