View
229
Download
1
Tags:
Embed Size (px)
Citation preview
Web Services
Overview
Why Web Services What’s Web Services Web Services Framework insfrastructure
Why Web Services?
Example Problem Space
ClientPO Service
Credit Service
Inventory Service
Purchase Order
Credit
Check
ReserveInventory
Credit
Response
InventoryResponse
InvoiceConsolidate
Results
Early (Internet) Technologies
SMTP/MIMEe-mail is still the killer app
FTP, NNTPHTTP/HTTPS, HTML
the protocol behind Internet’s popularity
Most of these facilitated app to human interaction
over the Internet/intranet
Early (intranet) Technologies
DCE from OSF -- RPC based, procedural ORB -- object oriented, mostly synchronous
CORBA, COM/DCOM from Microsoft, Java RMI/EJBs
MOM -- message oriented, synchronous as well as asynchronous JMS ( Java API standard ) Many proprietary implementations
Most of these facilitated app2app interaction within atrusted intranet and without much consideration to interoperability across different implementations.
Today’s Web
Web designed for application to human interactions Served very well its purpose:
Information sharing: a distributed content library. Enabled B2C e-commerce. Non-automated B2B interactions.
How did it happen? Built on very few standards: http + html Shallow interaction model: very few assumptions made about
computing platforms. Result was ubiquity.
The issue: Unleashing B2B (and G2B!) As mentioned above, most Web apps are for business-to-consumer (B2C):
person at browser Still too hard to build distributed applications that connect businesses Risk losing customers if you provide URL links to a partners' website
Business-to-business (B2B) apps have been highly touted, but suffered for the following reasons: Isolation of business processes because of incompatible systems
Microsoft's DCOM, Sun J2EE's Bridges available but app server vendor specific
Solutions were too costly or too complex to implement Business relationships change such as mergers and acquisitions Accelerated pace of change in technology and standards
ASP 2.0, ASP 3.0, ASP.NET EJB 1.0, EJB 1.1, EJB 2.0
Need a simple, standard framework for B2B applications
What’s next?
The Web is everywhere. There is a lot more we can do! E-marketplaces. Open, automated B2B e-commerce. Business process integration on the Web. Resource sharing, distributed computing.
Current approach is ad-hoc on top of existing standards. e.g., application-to-application interactions with HTML forms.
Goal:
enabling systematic application-to-application interaction on the Web.
The Web Services Way
Web Services standards (SOAP, WSDL, … ): based on widely accepted Internet friendly technologies
(HTTP/HTTPS, XML, …), are mostly orthogonal to each other and enjoy broad support from vendors
Web Services: Network accessible programs, expose functionality by receiving/sending SOAP messages
over HTTP/HTTPS, and describe this interface as WSDL descriptions.
App2App Interaction -- the Web Services Way
Transport protocol HTTP/HTTPS
Data Encoding SOAP (Simple Object Access Protocol), XML Schema
Interface Description WSDL (Web Services Description Language)
Service Description and Discovery UDDI (Universal Description, Discovery and
Integration) Security
WS-Security, XML-Signature, XML-Encryption, ...
What’s a Web Service?
“Web services” is an effort to build a distributed computing platform for the Web.
Yet another one!
What’s a Web Service? A web service is a software component
Exposes a business function/service/chunk of data Can be accessed by another application over Internet Messages are exchanged using a standard XML format
Application Server (J2EE or .NET)
Business logic
Web Service
Web Application
BusinessBusiness
AgencyAgency
<xml>
<xml>
<html>
<html>
What’s a Web Service? A program programmatically accessible over
standard internet protocols
Loosely coupled, reusable components
Encapsulate discrete functionality
Distributed
Add new level of functionality on top of the current web
Web Services Model
Web service applications are encapsulated, loosely coupled Web “components” that can bind dynamically to each other
Web Services Model
Language and platform independent =>separation of specification and implementation
Loosely coupled => message based, synchronous and asynchronous interactions.
Over the Internet =>No centralized control, use of established protocols, security considerations.
Inter-operable =>Standards based.
How Web Services Helps Cross-platform, cross-language support
Java, .NET, PHP, Perl, Python Based on industry standards (W3C)
Catches the XML wave XML, SOAP, WSDL, UDDI
Supported by many vendors Unlike CORBA
Relatively easy to implement Service publication and lookup
Conduct business without prior relationship Loosely coupled
Low demands on network quality Based on request/response model
Enables public/private cooperation on information products
Web Services Framework
Web Services Framework
Web Services Framework
Framework can be described in terms of
What goes “on the wire”: Formats and protocols.
What describes what goes on the wire:Description languages.
What allows us to find these descriptions:Discovery of services.
The Web Services StackWire
ProtocolsDescription Discovery
TCP/IP
HTTP/SMTP/BEEP
XML
SOAP/XMLP
SOAP Blocks
XML
WSDL
WSDL Extensions
Process
Agreements
Inspection
Registry (UDDI)
The Web Services Stack helps us understand how each of the various pieces fit into the “Big Picture”
The Web Services Stack
Wire Protocols Primary Role: provide a standard, flexible
communications channel Secondary Role: provide a standard, flexible wire-
level data representation
Advantage: interoperability at the lowest level
The Web Services Stack
Description Primary Role: provide a standard, flexible way to
describe what and how a Web service does what it does.
Advantage: interoperability
The Web Services Stack
Discovery Primary Role: provide a standard, flexible way to
discover where a Web service is located and where to find more information about what the Web service does (the description)
Advantage: interoperability, dynamic integration
WS-Resource Framework Capabilities
Specifies how to use XML to describe and access a resource’s properties
Clarifies how stateful resources are addressedDefines how a resource is created and messages to
destroy resourcesProvides a message subscription and notification
mechanism for Web services Outlines how to organize groups of resources and
services Adds a fault tolerance capability to WS-Addressing Defines a standard, extensible format for Web
services error messages
Web Services and Stateful Resources
“State” appears in almost all applications Data in a purchase order Current usage agreement for resources on a grid Metrics associated with work load on a Web
server There are many possible ways Web services
might model, access and manage state The WS-Resource framework proposes to
standardize this capability for Web services
Inte
rface
WebService
The WS-Resource framework model
Web Service
WSDLRun-time environment
Inte
rface
WebService
message
message
Invoking a Web Service
address
Endpoint Reference
Run-time environment
The WS-Resource framework model
What is a WS-Resource Examples of WS-Resources:
Physical entities (e.g.. processor, communication link, disk drive)or Logical construct (e.g.. agreement, running task, subscription)
Real or virtual
Static (long-lived, pre-existing) orDynamic (created and destroyed as needed)
Simple (one), or Compound (collection)
Unique - Has a distinguishable identity and lifetime
Stateful - Maintains a specific state that can be materialized using XML
May be accessed through one or more Web Services
resource
The WS-Resource framework model
context
Inte
rface
WebService
messageid
message
Using a Web service to access a WS-Resource
id
address
resource
Run-time environment
Endpoint Reference
The WS-Resource framework model
context
Inte
rface
WebService
messageid
message
Using a Web service to access a WS-Resource
id
address
resource
resource
Endpoint ReferenceEndpoint Reference
The WS-Resource framework model
Run-time environment
Inte
rface
WebService
message
message
Creating / Locating a WS-Resource
address
Endpoint Reference
resource
Endpoint Reference
Web Service either locates or creates a
WS-Resource
address
id
The WS-Resource framework model
Run-time environment
IBM
WS-Resource Properties Resource state and metadata “Projected” as an
XML document Query and Set operations
WS-Resource LifeTime Explicit destruction or
“Soft state” time-to-live Provides for cleanup
of resource instances
resource
<ProcessorProperties><ProcID>5A34C1DE03</ProcID><ProcArchitecture>Power6.2</ProcArchitecture><ProcSpeedMIPS>400</ProcSpeed><ProcCacheMB>256<ProcCache><ProcRunning>1</ProcRunning>
</ProcessorProperties>
The WS-Resource framework model
Architecture rationale WS-Resource framework exploits WS-Addressing
Web services and WS-Resources are referenced using an “Endpoint Reference”
Services that create or locate WS-Resources returnEndpoint References
Web service and WS-Resource are separate: A Web service is stateless A WS-Resource provides a context for stateful
execution Different entities, different lifetimes, different
capabilities
The WS-Resource framework model
Web Services Infrastructure
Language and platform independent infrastructure for loosely-coupled, inter-
operable, app2app communication over the Internet.
Additional Web Services Infrastructure Components
Key Management (Security) XKMS
Web Services Management OMI (Open Management Interface)
...
Interesting thing to note is that these
are Web Services in themselves
XML Messaging: SOAP XML based protocol for
exchange of information Encoding rules for datatype
instances Convention for representing
RPC invocations Designed for loosely-
coupled distributed computing No remote references
Used with XML Schema Transport independent SOAP with Attachments
allow arbitrary data to be packaged.
SOAP1.1 MessageStructure
SOAPEnvelope
HeaderEntries
[Header Element]
Body Element
[FaultElement]
XML Messaging: SOAP
SOAP 1.1 defined: An XML envelope for XML messaging,
Headers + body An HTTP binding for SOAP messaging.
SOAP is “transport independent”. A convention for doing RPC. An XML serialization format for structured data
SOAP Attachments adds How to carry and reference data attachments using in a
MIME envelope and a SOAP envelope.
The SOAP Envelope
<SOAP-ENV:Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
< SOAP-ENV:Header> ... </ SOAP-ENV:Header>
< SOAP-ENV:Body> ... </ SOAP-ENV:Body> ...</ SOAP-ENV: Envelope>
What goes on the wire
Internet-scale integration needs a lingua-franca XML messaging protocol
over HTTP: SOAP
Intra-enterprise integration needs to allow alternates: CORBA, RMI Messaging In-memory method calls
SOAP SOAP
SecuritySecurity
AttachmentsAttachments
ReliabilityReliability
RoutingRouting
TransactionsTransactions
ContextContext
W3C
Descriptions: Meta-data
Integration requires interoperable machine-understandable descriptions
Enables dynamic, delayed binding of components.
Language extensibility provides support for different levels of application integration.
InterfaceInterface
Service QoS Service QoS
ServiceService
Public FlowsPublic Flows
Flows and Composition
Flows and Composition
AgreementsAgreements
WS
DL
WS
FL
XML SchemaXML Schema
Web Services Description Language
Provides functional description of network services: IDL description Protocol and deployment details Platform independent description. Extensible language.
A short history: WSDL v1.0, 9/2000 WSDL v1.1 submitted to W3C 3/2001. A de facto industry standard.
WSDL - Overview
A WSDL document describesWhat the service can doWhere it residesHow to invoke it
WSDL are like IDL but lot more flexible and extensible
Defines binding for SOAP1.1, HTTP GET/POST and MIME
WSDL descriptions can be made available from an UDDI registry
WSDL - Overview
WSDL is a simple XML grammar for describing how to communicate with a Web service It defines the messages (both abstract and concrete) that
are sent to and from a service It defines logical collections of messages (“port type”,
“interface”) It defines how a given “port type” is bound to particular
wire protocols It defines where the service is located
WSDL Overview
WSDL is extensible. WSDL was created by IBM and Microsoft
The intent was to create something that worked, not something that was complete
Creating a formal Web Services “data model” was not a priority
WSDL is RDF-compatible (not RDF-compliant)
WSDL Structure
WSDL1.1 DocumentStructure
WSDLDocument
[Types]
{Messages}
{Port Types}
{Bindings}
{Services}
WSDL Structure
portType Abstract definition of a
service (set of operations) Multiple bindings per
portType: How to access it SOAP, JMS, direct call
Ports Where to access it
Service
Port(e.g. http://host/svc)
Binding(e.g. SOAP)
Abstract interface
portType
operation(s)
inMesage outMessage
Port
Binding
WSDL - example<definitions>
<types> <!-- XML Schema --> </types>
<message name=“getQuote_In” />
<message name=“getQuote_Out” />
<portType name=“StockQuoteServiceInterface”>
<operation name=“getQuote”>
<input message=“getQuote_In” />
<output message=“getQuote_Out” />
</operation>
</portType>
<binding name=“StockQuoteServiceBinding” type=“StockQuoteServiceInterface”>
<soap:binding transport=“http://schemas.xmlsoap.org/soap/http” />
…
</binding>
<service name=“StockQuoteService”>
<port name=“StockQuoteServicePort” binding=“StockQuoteServiceBinding”>
<soap:address location=“http://www.acme.com/services/stockquote” />
</port>
</service>
</definitions>
Definition of data types
Definition of messages
Definition of port type
Definition of the bindings
Definition of the service
Using WSDL
1. As extended IDL: WSDL allows tools to generate compatible client and server stubs. Tool support for top-down, bottom-up and “meet in the
middle” development.2. Allows industries to define standardized service interfaces.3. Allows advertisement of service descriptions, enables dynamic
discovery and binding of compatible services. Used in conjunction with UDDI registry
4. Provides a normalized description of heterogeneous applications.
Client Proxy object
RMI-IIOP
JMS/MQ
SOAP/HTTP
Client invocation
Single stub can invoke services over different bindings Depends only on abstract
interface. Are independent of binding (but
pluggable). Add new bindings without
recompiling/redeploying stub Allows optimisations based on
the bindings of service. Will support extended services
models if described In WSDL
WSFL Overview
WSFL describes Web Service compositions.1. Usage patterns of Web
Services: describes workflow or business processes.
2. Interaction patterns: describes overall partner interactions.
A
B
C
[ WS]
[ WS]
WSFL Flow Models
Activities represent units of processing.
Flow of data is modeled through data links.
[ WS]
Activities can be mapped to the flow interface
Control links define execution flow as a directed acyclic graph
Activities are associated with specific typed service providers
Using Flow Models
“Public flows” provide a representation of the service behavior as required by its users.
Typically, an abstraction of the actual flow begin executed Defines a “behavioral contract” for the service. Internal implementation need not be flow-based. Flows are reusable: specify components types, but not what specific
services should be used!
“Private flows” are the flows executed in practice. WSFL serves as a “portable flow implementation language”
Same language is used in WSFL to represent both types of processes.
Global Models
Global models describe how the composed Web Services interact. RosettaNet automated. Like an ADL.
Interactions are modeled as links between endpoints of two service interfaces (WSDL operations).
An essentially distributed description of the interaction.
A
B
C
Discovery: Finding Meta-data
Static binding requires service “libraries”.
Dynamic binding requires runtime discovery of meta-data
InspectionInspection
DirectoryDirectory
ADS,DISCO
UDDI
UDDI Overview
UDDI is: A Web Services API for publishing and
discovering the existence of Web services A registry for managing information about Web
services A coalition of organizations working together to
manage UDDI registries and to further develop the Web Services API for accessing those registries.
UDDI Overview
UDDI is built around a “Yellow-pages” like data model:
Business Entity
Business Services
Service Bindings
Categories
Identities
TModels
UDDI Overview
TModel = “Technology Model”
TModel TModel Instance
Abstract metadata definition relating to some aspect of the UDDI registration
Implementation specific metadata conforming to a given TModel.
TModel = Abstract Class
UDDI Overview TModels
Categories & Identifiers Categorization and Identification taxonomies are TModels Categories and Identifiers are TModel Instances Keyed Referenced
Name + Value + TModel Examples: NAICS, UNSPSC, D&B #
WSDL Port Types WSDL Port Types are TModels WSDL Services that are bound to a Port Type are TModel Instances
WSFL Business Processes WSFL Flow Models are TModels WSFL Global Models are TModel instances
TModels represent the extent of UDDI’s semantic description capabilities.
UDDI Overview
UDDI has only limited extensibility through TModels
UDDI was created by IBM, Microsoft and Ariba (many companies have joined the effort)
The intent was to put something together that worked.
UDDI Overview
UDDI Version 1.0 – September 2000 (in production)
UDDI Version 2.0 – June 2001 UDDI Version 3.0 - In development
UDDI will be presented to a standards body after Version 3.0
UDDI Overview
UDDI defines the operation of a service registry: Data structures for registering
Businesses Technical specifications: tModel is a keyed reference to a
technical specification. Service and service endpoints: referencing the supported
tModels SOAP Access API Rules for the operation of a global registry
“private” UDDI nodes are likely to appear, though.
UDDI RelationshipsWeb Service
Web Service
SIC CODENAICS
DUNS NumbersThomas Registry ID
Rosetta-NetBASDA
Simple.Buy
Schemas,Interchange specification
businessEntitybusinessEntitybusinessEntity
businessServicebusinessService
bindingTemplatebindingTemplateInstanceDetailsInstanceDetails
categoryBagkeyedReferencekeyedReference
identifierBagkeyedReferencekeyedReference
tModels
WS-Notification
WS-NotificationBrings enterprise quality publish and subscribe messaging to Web services
Loosely coupled, asynchronous messaging in a Web services context
WS Notification exploit WS Resource framework and Web services technologies
Subscriber indicates interest in a particular “Topic” by issuing a “subscribe” request
Broker (intermediary) permits decoupling Publisher and Subscriber
“Subscriptions” are WS-Resources
Various subscriptions are possible
Publisher need NOT be a Web Service
Notification may be “triggered” by:WS Resource Property value changesOther “situations”
Broker examines current subscriptions Brokers may
“Transform” or “interpret” topicsFederate to provide scalability
Broker
Subscriber
WS-Notification
Publisher
subscribe
subscribe
S S S
notify
notify
notify
notify
WS-Notification Characteristics of WS-Notification:
Web services integration of traditional enterprise publish/subscribe messaging patterns
Composes with other Web services technologies Facilitates integration between different messaging
middleware environments Standardizes the role of Brokers, Publishers, Subscribers and
Consumers Provides two forms of publish/subscribe:
direct publishing and brokered publishing Standardizes Web service message exchanges for publishing,
subscribing and notification delivery Defines XML model of Topics and TopicSpaces to categorize
and organize notification messsages
A
ServiceLevel
WS-Resource framework & WS-NotificationScenario: Grid Resource Management & Scheduling
Cluster
RRR
Mainframe
RRRIBM
IBM
Blades
RRR
Notification
GridScheduler
WS-Resource used to “model” physical
processor resources
WS-Resource Properties “project” processor status (like utilization)
Local processor manageris “front-ended” with A Web service interface
Other kinds of processors are also
“modeled” as same type of WS-Resources
JJ
J
WS-Notification can be used to “inform” the scheduler when processor utilization
changes
Grid “Jobs” and “tasks” are also modeled using
WS-Resources and Resource Properties
Grid Scheduler
is a Web Service
Service Level Agreement
is modeled as a WS-
Resource Lifetime of SLA Resource tied to the duration
of the agreement