Web Services

advertisement
Web Services
Vagelis Hristidis
FIU
What is the “Transactional Web”


Today: “The eye-ball Web” - the architecture
of the Web is geared towards delivering
information visually.
Tomorrow: “The transactional Web” – the
architecture of the Web geared towards
intelligently exchanging information between
applications.
3/14/2016
2
What is the “Transactional
Web”


“Web Services” (plural) is a blanket term
representing all of the technologies that
enable the “transactional web” to exist.
“Web Service” (singular) is a term referring to
a collection of application operations
accessible over a network using Web
Services technologies.
3/14/2016
3
Why do we need Web Services?






Standard way to export functionality
To implement the Semantic Web
Allow agents
Allow communication between applications
Allow searching for available applications
Examples: stock quotes, retail, b2b,
libraries,…
3/14/2016
4
WSAH
(Web Services Acronym Hell)
DIME
ebXML
XML
JABBER
SOAP-SEC
SOAP
SAML
WSDL
SOAP-RP
XML-ENC
XML-RPC
XMLP
DISCO
XLANG
CPP-CPA
WSFL
DAML-S
XKMS
XSD
WSEL
UDDI
DSML
P3P
X-KISS
BPEL
XML-DIGSIG
PKI
DISCO
3/14/2016
5
Roadmap






Web Services Stack
SOAP
WSDL
UDDI
Web Services Composition - BPEL
Issues
3/14/2016
6
The Web Services Stack
Wire Protocols
Description
Discovery
SOAP Blocks
Agreements
SOAP/XMLP
Process
XML
WSDL Extensions
HTTP/SMTP/BEEP
WSDL
Registry (UDDI)
TCP/IP
XML
Inspection
The Web Services Stack helps us understand how each of the various pieces fit into the “Big Picture”
3/14/2016
7
The Web Services Stack

Wire Protocols



3/14/2016
Primary Role: provide a standard, flexible
communications channel
Secondary Role: provide a standard, flexible wirelevel data representation
Advantage: interoperability at the lowest level
8
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
3/14/2016
9
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
3/14/2016
10
Web Services Stack
Choreography - CDL4WS
Orchestration - BPEL4WS
Business
Processes
Management
Transactions
WS-Reliability
WS-Security
Coordination
Quality of
Service
Context
UDDI
Discovery
WSDL
Description
Description
SOAP
Message
XML
HTTP,IIOP, JMS, SMTP
3/14/2016
Transport
11
Roadmap






Web Services Stack
SOAP
WSDL
UDDI
Web Services Composition - BPEL
Issues
3/14/2016
12
SOAP




SOAP stands for Simple Object Access Protocol
Made up of three major parts
 A messaging framework
 An encoding standard
 An RPC (remote procedure call) framework
It is possible to use just the messaging framework or
messaging framework/encoding standard without using
the RPC mechanism (though latter is where much of
power lies).
SOAP is based entirely on XML
3/14/2016
13
SOAP: Messaging framework




Just defines a generic document type using
XML
This document type represents the
abstraction of a message
Virtually any type of message you can think
of can be packaged as a SOAP message.
However, doing so without RPC mechanisms
takes only very small advantage of the
features defined in the SOAP standard
3/14/2016
14
General (Basic) Structure SOAP
Message

Envelope


Header (optional)



Defines the content of
the message
Contains destination
information, versioning,
extensions
Good place for security
SOAP Envelope
SOAP Header
SOAP Body
Payload Document(s)
SOAP Fault
Body

3/14/2016
Contains payload
15
General (Basic) Structure
SOAP Message
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/encoding/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/enco
ding/"
>
<soap:Header>
... ...
</soap:Header>
<soap:Body>
<!-- User request code here -->
<soap:Fault>
... ...
</soap:Fault>
</soap:Body>
</soap:Envelope>
3/14/2016
16
SOAP encoding

The second component of SOAP is a standard for how to represent
common datatypes as SOAP types. This is knows as the encoding
style.

SOAP does this in a language agnostic way, much like CORBA (but
not in binary form)

For example, SOAP stipulates that an array of three integers be
represented as:
SOAP-ENC:Array SOAP-ENC:arrayType="xsd:int[3]">
<SOAP-ENC:int>8</SOAP-ENC:int>
<SOAP-ENC:int>5</SOAP-ENC:int>
<SOAP-ENC:int>9</SOAP-ENC:int>
</SOAP-ENC:Array>
3/14/2016
17
SOAP RPC



The third part of SOAP is an RPC
mechanism that turns messages into method
calls
We have a generic message structure + data.
It requires just a little more work to turn the
message into a function call.
Must be a way to represent parameters and
return values, exceptions, etc.
3/14/2016
18
SOAP RPC cartoon
VB
application
Java
application
Invoice
VB-Structure
Invoice
Java-Structure
SOAP
client
SOAP
Server
SOAP
Message
The client application thinks its making a procedure
call to a remote module
3/14/2016
19
SOAP protocol bindings



Question:how are SOAP messages transmitted?
Answer: using existing protocols (http, SMTP, etc.)
This has some obvious advantages vs. defining its
own protocol


Piggybacks on security model, general robustness
SOAP defines bindings to different protocols that
specify how SOAP is used with that protocol to send
messages.

3/14/2016
http is most popular
20
Roadmap






Web Services Stack
SOAP
WSDL
UDDI
Web Services Composition - BPEL
Issues
3/14/2016
21
Source

WSDL 1.1 specification


WSDL 2.0 working draft, 26 June 2007


http://www.w3.org/TR/wsdl
http://www.w3.org/TR/wsdl20/
W3C School Tutorial

3/14/2016
http://www.w3schools.com/wsdl/wsdl_intro.asp
22
What is WSDL


Web Service Description Language.
An XML language used to describe and locate web
services.




Written in XML.
Describe functionality of a web service
Specify how to access the service (binding protocol,
message format, and etc.)
Not a W3C standard yet.


3/14/2016
Version 1.1 released March 2001
W3C Recommendation of Version 2.0 released June
2007
23
Related Standards



Type System: XML Schema
Name space: XML namespaces
Binding: SOAP, HTTP, MIME and etc.
3/14/2016
24
The Main Structure of WSDL
<definition namespace = “http/… “>
<type> xschema types </type>
<message> … </message>
<port> a set of operations </port>
<binding> communication protocols </binding>
<service> a list of binding and ports </service>
<definition>
3/14/2016
25
WSDL - Overview
<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” />
Definition of data types
Definition of messages
Definition of port type
Definition of the bindings
</operation>
</portType>
<binding name=“StockQuoteServiceBinding” type=“StockQuoteServiceInterface”>
<soap:binding transport=“http://schemas.xmlsoap.org/soap/http” />
…
</binding>
Definition of the service
<service name=“StockQuoteService”>
<port name=“StockQuoteServicePort” binding=“StockQuoteServiceBinding”>
<soap:address location=“http://www.acme.com/services/stockquote” />
</port>
</service>
</definitions>
3/14/2016
26
Types



<types> define types used in message
declaration
XML Schema, DTD, and etc.
XML Schema must be supported by any
vendor of WSDL conformant products.
3/14/2016
27
<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol" type="string“
minOccur = “1” maxOccur=“10”/>
<element name = “payment”>
<complexType> <choice>
<element name = “account” type=“string”>
<element name = “creditcard” type=“string”>
</choice> </complexType>
</element>
</all>
</complexType>
</element>
</schema>
</types>
3/14/2016
28
WSDL Messages


The <message> element defines the data
elements of an operation.
Each messages can consist of one or more
parts. The parts can be compared to the
parameters of a function call in a traditional
programming language.
3/14/2016
29
<message name="GetLastTradePriceInput">
<part name="body" element="TradePriceRequest"/>
</message>
<message name="GetLastTradePriceOutput">
<part name="body" element="TradePrice"/>
</message>
3/14/2016
30
WSDL Ports




The <portType> element is the most important WSDL
element.
It defines a web service, the operations that can be
performed, and the messages that are involved.
The <port> defines the connection point to a web
service, an instance of <portType>.
It can be compared to a function library (or a module, or
a class) in a traditional programming language. Each
operation can be compared to a function in a traditional
programming language.
3/14/2016
31
<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/>
<output message="tns:GetLastTradePriceOutput"/>
</operation>
</portType>
3/14/2016
32
Operation Types

The request-response type is the most
common operation type, but WSDL defines
four types:
• One-way: The operation can receive a message but
will not return a response
• Request-response:The operation can receive a
request and will return a response
• Solicit-response:The operation can send a request
and will wait for a response
• Notification:The operation can send a message but
will not wait for a response
• -- v 1.2 addition
request – multiple response …
3/14/2016
33
One way and Notification
Example
<portType name=“RegisterPort">
<operation name=“register">
<input name=“customerInfo" message=“RegInfo"/>
</operation>
<operation name = “register Response”>
<output name = “response” message=“ResponseInfo”/>
</operation>
</portType >
3/14/2016
34
Binding

Binding defines how message are
transmitted, and the location of the service.
3/14/2016
35
<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetLastTradePrice">
<soap:operation soapAction="http://example.com/GetLastTradePrice"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
3/14/2016
36
<service name="StockQuoteService">
<documentation>My first service</documentation>
<port name="StockQuotePort" binding="tns:StockQuoteBinding">
<soap:address location="http://example.com/stockquote"/>
</port>
</service>
3/14/2016
37
Roadmap






Web Services Stack
SOAP
WSDL
UDDI
Web Services Composition - BPEL
Issues
3/14/2016
38
WSDL and UDDI



Description of web service.
Discovery of web service?
UDDI – yellow page.
3/14/2016
39
What is UDDI




UDDI is a platform-independent framework for
describing services, discovering businesses, and
integrating business services by using the Internet.
UDDI stands for Universal Description, Discovery and
Integration
UDDI is a directory for storing information about web
services
UDDI is a directory of web service interfaces described
by WSDL or another description language
3/14/2016
40
UDDI Overview

UDDI is:



3/14/2016
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.
41
UDDI Overview

UDDI is built around a “Yellow-pages” like
data model:
Business Entity
Identities
Business Services
Categories
Service Bindings
TModels
3/14/2016
42
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
3/14/2016
43
UDDI Overview

TModels
 Categories & Identifiers



Categorization and Identification taxonomies are TModels
Categories and Identifiers are TModel Instances
Keyed Referenced



Examples: NAICS, UNSPSC, D&B #
WSDL Port Types



Name + Value + TModel
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.
3/14/2016
44
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.
3/14/2016
45
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
3/14/2016
46
How can UDDI be Used



If the industry published an UDDI standard
for flight rate checking and reservation,
airlines could register their services into an
UDDI directory.
Travel agencies could then search the UDDI
directory to find the airline's reservation
interface.
When the interface is found, the travel
agency can communicate with the service
immediately because it uses a well-defined
reservation interface. (by WSDL)
3/14/2016
47
WSDL in UDDI
WSDL
3/14/2016
UDDI
48
WSDL in UDDI

Since the service interface represents a reusable definition of a
service, it is published in a UDDI registry as a tModel
3/14/2016
49
WSDL in UDDI
3/14/2016
50
Roadmap






Web Services Stack
SOAP
WSDL
UDDI
Web Services Composition - BPEL
Issues
3/14/2016
51
Web Services Stack
Choreography - CDL4WS
Orchestration - BPEL4WS
Business
Processes
Management
Transactions
WS-Reliability
WS-Security
Coordination
Quality of
Service
Context
UDDI
Discovery
WSDL
Description
Description
SOAP
Message
XML
HTTP,IIOP, JMS, SMTP
3/14/2016
Transport
52
How to leverage the full
potential of Web Services


Multiple invocation between two or more
services
All parties - Service providers and service
clients
SERVICE FLOW
3/14/2016
53
Web Services Meet Business
Processes
3/14/2016
Web
Service 1
Web
Service 4
Web
Service 2
Web
Service 5
Web
Service 3
Web
Service n
54
Example Problem Space
Credit
Service
Purchase
Invoice
Order
Client
Consolidate
Results
PO Service
Inventory
Service
3/14/2016
55
Business Process Challenges




Coordinate asynchronous 
communication between
services
Correlate message

exchanges between
parties
Implement parallel
processing of activities

...

3/14/2016
Manipulate/transform
data between partner
interactions
Support for long
running business
transactions and
activities
Provide consistent
exception handling
...
56
Recent History of
Business Process Standards
BPML
(Intallio et al)
BPSS
(ebXML)
2000/05 2001/03 2001/05
XLang
(Microsoft)
3/14/2016
WSFL
(IBM)
2001/06
WSCI
(Sun et al)
2002/03
WSCL
(HP)
2002/06
WS-Choreography
(W3C)
2002/08
BPEL4WS 1.0
(IBM, Microsoft)
BPEL4WS 2.0
(OASIS)
2003/01 2003/04
2007
BPEL4WS 1.1
(OASIS)
57
Orchestration vs Choreography

Orchestration


An executable business process describing a flow
from the perspective and under control of a single
endpoint (commonly: Workflow)
Choreography

3/14/2016
The observable public exchange of messages,
rules of interaction and agreements between two
or more business process endpoints
58
Sample Business Process:
Purchase Order
Sample Purchase Order
Purchase Order Request
Business
“A”
Business
Purchase Order Acknowledgement
“B”
Purchase Order Response
3/14/2016
59
From a Choreography
Perspective
Public Process
Business A
Send
PO
Receive PO
Ack
Receive PO
Response
Business B
PO Request
Receive
PO
PO Acknowledgement
Send
PO Ack
PO Response
Send PO
Response
Choreography – The observable public exchange of messages
3/14/2016
60
From an Orchestration
Perspective
Private Process
Business A BPEL Workflow
Transform
From ERP
To ERP
Transform
Send
PO
PO Request
Receive PO
Ack
PO Acknowledgement
Receive PO
Response
PO Response
Orchestration – A private executable business process
3/14/2016
61
Orchestration and
Choreography Together
Business Analyst Tool
Business
A
Generate BPEL
Template
Business
B
Business B BPEL Workflow
Business A BPEL Workflow
Transform
Send
PO
Receive PO
Ack
Transform
Receive PO
Response
Generate BPEL
Template
PO Request
Receive
PO
Transform
Send PO Ack
PO Acknowledgement
PO Response
Receive PO
Response
Transform
Two BPEL workflow templates reflecting a business agreement
3/14/2016
62
WSFL




Web Service Flow Language
By IBM
To fit into the WS Stack naturally
XML-based grammar to describe WS
interactions
3/14/2016
63
Multi-party business
processes


Operational description
 WSDL (Web Service Description Language)
Composition and choreography of WS
 WSFL (Web Service Flow Language)
3/14/2016
64
Flow Composition in WSFL (I)

Choreograph functionalities of a collection of
WS

Logic of a business process

Specification of the execution sequences of
the functionalities of services
3/14/2016
65
Flow Composition in WSFL (II)



Business tasks
Control flow
Data flow
Activities represent
units of processing.
[ WS]
Activities are associated
with specific typed
service providers
Control links define
execution flow as a
directed acyclic graph
Flow of data is
modeled through
data links.
3/14/2016
Activities can be
mapped to the flow
interface
66
Global Composition in WSFL





Specification of interaction pattern of a
collection of WS
No specification of execution sequence
Interactions between service providers and
service requestors
A
Peer-to-peer interactions
C
Hierarchical interactions
B
3/14/2016
67
Web Services Stack
Choreography - CDL4WS, WSCI
Orchestration - BPEL4WS, BPML
Business
Processes
(WS Composition)
Management
Transactions
WS-Reliability
WS-Security
Coordination
Quality of
Service
Context
UDDI
Discovery
WSDL
Description
Description
SOAP
Message
XML
HTTP,IIOP, JMS, SMTP
3/14/2016
Transport
68
BPML/WSCI
 Complementary efforts
 Business Process Model Language (Orchestration)



describes executable business processes
private
Web Services Choreography Interface



3/14/2016
describes messages between collaborating web services
XML-based language for WS collaboration
Public interactions and choreographies between services
69
BPML




XML-based meta-language
Developed by Intalio, SUN, SAP, Versata,
CSC, SeeBeyond (www.bpmi.org Business Process Management Initiative)
Modeling collaborative and transactional
business processes
Relying on a formal model
3/14/2016
70
BPML – 5 elements





Activities
performance of simple or complex functions
Processes
types of complex activities that define its own
context
Contexts
environment for the execution of activities
Properties
information exchange within a context
Signals
coordination of activities
3/14/2016
71
BPML key features







basic activities for sending, receiving, and invoking
services
handles conditional, sequential, and parallel
activities
for Long-running processes supporting persistence
supports short and long-running transactions
robust exception handling mechanisms
Recursive composition
No automation support! Services and partners to be
specified at design time
3/14/2016
72
WSCI

Defines overall choreography of WS taking part in an
interaction

BEA Systems, BPMI.org, Commerce One, Fujitsu Limited, Intalio, IONA, Oracle
Corporation, SAP AG, SeeBeyond Technology Corporation and Sun
Microsystems.

Uses messages
No focus on the definition of executable business
processes (that‘s what BPML does)
Direct correspondence to WSDL





3/14/2016
Each WSCI unit of work  WSDL operation
WSDL: entry points of each service
WSCI: interactions among WSDL operations
73
WSCI – key features (I)

Support for basic activities:



3/14/2016
each activity specifies the WSDL operation
involved
use <action> to define a basic request/response
message
use <call> to invoke external services
74
WSCI – key features (II)

Support for structured activities:



sequential, parallel, and conditional looping
use <all> to specify unordered actions to perform
Support for business transactions and
exceptions:


3/14/2016
transactional contexts can be defined in WSCI
any failure in a context will result in all
transactions in context being rolled back
75
WSCI – concepts (I)

Interface
Observable behaviour of a WS in a message
exchange with other WS

Activities
Basic unit of behaviour; either atomic or complex
(composed of other activities)

Processes
Top-level processes and nested processes

Properties
Reference a value within an IF definition
3/14/2016
76
WSCI – concepts (II)

Context
Environment: a set of activities is executed

Message correlation
Structure of conversations, management of multiple
conversations with the partner

Exceptional behaviour
Alternative patterns of behaviour; association to activities


Transactional behaviour
Global model
Overall message exchange
3/14/2016
77
BPEL4WS- BPML

BPML is a strict superset of BPEL4WS

BPML and BPEL4WS share an identical set
of idioms and similar syntaxes as the basis of
convergence

BPML provides a rich and mature language
for expressing both simple and complex
business processes
3/14/2016
78
BPEL4WS – BPML

BPML and BPEL4WS are both blockstructured languages, with the addition of
nested processes in BPML

BPML is based on a logical process model
that can fully express concurrent, repeating,
and dynamic tasks

BPML builds on the foundation of WSCI for
expressing public interfaces and
choreographies
3/14/2016
79
BPEL4WS – BPLM/WSCI

WSCI/BPML has much richer choreography
support and backing by W3C working group

BPEL4WS has major supporters behind it,
with developer tools and documentation
already available
3/14/2016
80
BPEL4WS – BPLM/WSCI
3/14/2016
Colloborative
Protocols
BPEL4W S
Abstract
Processes
W SCI
Executable
Business
Processes
BPEL4W S
Executable
Processes
BPML
BPEL4W S
(IBM, Microsoft, BEA)
W SCI/ BPML
(Sun, Intalio, SAP)
81
Business Process Execution
Language for Web Services
•
Version 1.0 released by IBM, Microsoft and BEA in
August 2002
•
Accompanied by WS-Coordination, WS-Transaction which
remain unsubmitted to standards bodies
•
Version 1.1 submitted to OASIS April 2003
•
XML language for describing business processes
based on Web services
•
•
Convergence of XLANG (Microsoft) and WSFL (IBM)
Unprecendented industry consensus
•
3/14/2016
IBM, Microsoft, Oracle, Sun, BEA, SAP, Siebel …
82
Value Proposition

Portable business processes


Industry wide language for business
processes


Built on top of an interoperable infrastructure of
Web services
Common skill set and language for developers
Choice of process engines

3/14/2016
Standards lead to competitive offerings
83
Standards Building Blocks of
BPEL
Choreography - CDL4WS
Orchestration - BPEL4WS
Business
Processes
Management
Transactions
WS-Reliability
WS-Security
Coordination
Quality of
Service
Context
UDDI
Discovery
WSDL
Description
Description
SOAP
Message
XML
HTTP,IIOP, JMS, SMTP
3/14/2016
Transport
84
BPEL Depends on WSDL and
WSDL Extensions
Service
Implementation
Definition
Service
Port
Binding
Service
Interface
Definition
Port types define Operations
Message
Type
3/14/2016
85
BPEL Scenario Structure
<process>
<!– Definition and roles of process participants -->
<partnerLinks> ... </partnerLinks>
<!- Data/state used within the process -->
<variables> ... </variables>
<!- Properties that enable conversations -->
<correlationSets> ... </correlationSets>
<!- Exception handling -->
<faultHandlers> ... </faultHandlers>
<!- Error recovery – undoing actions -->
<compensationHandlers> ... </compensationHandlers>
<!- Concurrent events with process itself -->
<eventHandlers> ... </eventHandlers>
<!- Business process flow -->
(activities)*
</process>
3/14/2016
86
BPEL Activities
Primitive Activities
 <invoke>
 <receive>
 <assign>
 <reply>
 <throw>
 <terminate>
 <wait>
3/14/2016
Structured Activities
 <sequence>
 <switch>
 <pick>
 <flow>
 <link>
 <while>
 <scope>
87
Partners


Declare the Web services and roles used by the
process
Tied to WSDL of the process itself and the
participating Web services by service link types
Partner 1
(the process)
Purchase
Service
3/14/2016
Partner 2
Partner 3
Credit
Service
Inventory
Service
88
Partners in BPEL
BPEL:
<partnerLinks>
<partnerLink name=“customer" serviceLinkType=“lns:purchasePLT”
myRole=“purchaseService”/>
<partnerLink name=“inventoryChecker”
serviceLinkType=“lns:inventoryPLT”
myRole=“inventoryRequestor” partnerRole=“inventoryService”/>
<partnerLink name=“creditChecker” serviceLinkType=“lns:creditPLT”
myRole=“creditRequestor” partnerRole=“creditService”/>
</partnerLinks>
Purchase Process WSDL:
Purchase Process PortType:
<plt:partnerLinkType name=“purchasePLT”>
<plt:role name=“purchaseService”>
<plt:portType name=“tns:purchasePT”/>
</plt:role>
</plt:partnerLinkType>
<portType name=“purchasePT”>
<operation name="sendPurchase">
</operation>
</portType>
3/14/2016
89
Variables

Messages sent and received from partners


Persisted for long running interactions
Defined in WSDL types and messages
Process
Customer
Service
<variable> <activity> <activity> <variable>
<A>
Persist
3/14/2016
Persist/
Retrieve
<B>
Persist/
Retrieve
Customer
Service
Persist/
Retrieve
90
Variables in BPEL
BPEL:
<variables>
<variable name=“PO” messageType=“lns:POMessage”/>
<variable name=“Invoice” messageType=“lns:InvMessage”/>
<variable name=“POFault” messageType=“lns:orderFaultType”/>
</variables>
Purchase Process WSDL:
<message name=“POMessage”>
<part name=“customerInfo” type=“sns:customerInfo”/>
<part name=“purchaseOrder” type=“sns:purchaseOrder”/>
</message>
<message name="InvMessage">
<part name=“IVC” type=“sns:Invoice”/>
</message>
<message name=“orderFaultType”>
<part name=“problemInfo” type=“xsd:string”/>
</message>
3/14/2016
91
How is Data Manipulation
Done?


Using <assign> and <copy>, data can be
copied and manipulated between variables
<copy> supports XPath queries to sub-select
data
<assign>
<copy>
<from variable="PO" part="customerInfo"/>
<to variable=“creditRequest”
part="customerInfo"/>
</copy>
</assign>
3/14/2016
92
Simple Activities

Receive



Reply



Wait for a partner inbound message
Can be the instantiator of the business process
Synchronous response to a receive activity
Response to the inbound receive from a partner
Invoke

3/14/2016
Issue a request synchronously *or* asynchronously
93
Structured Activities



Ordinary sequential control between activities
is provided by sequence, switch, and while.
Concurrency and synchronization between
activities is provided by flow.
Nondeterministic choice based on external
events is provided by pick.

3/14/2016
The pick activity awaits the occurrence of one of a
set of events and then performs the activity
associated with the event that occurred
94
Simple Activities Combined
with Structured Activities
Receive <PO>
Invoke <InventoryService>
Invoke <CreditService>
Reply <Invoice>
3/14/2016
<sequence>
<flow>
</sequence>
95
Sample Activities in BPEL
<sequence>
<receive partnerLink=“customer” portType=“lns:purchaseOrderPT"
operation=“sendPurchaseOrder” variable=“PO”
createInstance="yes" />
<flow>
<invoke partnerLink=“inventoryChecker”
portType=“lns:inventoryPT”
operation="checkINV" inputVariable="inventoryRequest"
outputVariable="inventoryResponse" />
<invoke partnerLink="creditChecker" portType=“lns:creditPT"
operation="checkCRED" inputVariable="creditRequest"
outputVariable="creditResponse" />
</flow>
...
<reply partnerLink=“customer” portType=“lns:purchaseOrderPT”
operation=“sendPurchaseOrder” variable=“invoice"/>
</sequence>
3/14/2016
96
Links – Control Flow
<flow>
<links>
<link name="XtoY"/>
<link name="CtoD"/>
</links>
<sequence name="X">
<source linkName="XtoY"/>
<invoke name="A" .../>
<invoke name="B" .../>
</sequence>
<sequence name"Y">
<target linkName="XtoY"/>
<receive name="C"/>
<source
linkName="CtoD"/>
</receive>
<invoke name="E" .../>
</sequence>
<invoke partnerLink="D">
<target linkName="CtoD"/>
</invoke>
</flow>
3/14/2016
<flow>
<X>
<A>
<link XtoY>
<B>
<Y>
<link CtoD>
<C>
<E>
<D>
</flow>
97
Correlation
PO
initiate=yes
Correlation:
<PO_CustId = 10>
<PO_OrdId = 100>
Customer
Seller
• SendPurchase
• ProcessPurchaseResponse
3/14/2016
initiate=yes
• AsynchPurchase
POResponse
• AsynchPurchaseResponse
initiate=no
Correlations:
<PO_CustId = 10>
<PO_OrdId = 100>
initiate=yes
<Inv_VendId = 20>
<Inv_InvId = 200> initiate=yes pattern=out
initiate=no pattern=out
98
Correlations in BPEL
<correlationSets>
<correlationSet name="POCorr" properties="cor:custId cor:ordId"/>
<correlationSet name="InvoiceCorr" properties="cor:vendId
cor:invId"/>
</correlationSets> ...
<receive partnerLink=“Customer” portType="SP:PurchaseOrderPT"
operation="AsynchPurchase" variable="PO">
<correlations>
<correlation set="POCorr" initiate="yes">
</correlations>
</receive> ...
<invoke partnerLink=“Customer” portType="SP:CustomerPT"
operation=“ProcessPurchaseResponse" inputVariable="POResponse">
<correlations>
<correlation set="POCorr" initiate="no" pattern="out">
<correlation set="InvoiceCorr" initiate="yes" pattern="out">
</correlations>
</invoke> ...
3/14/2016
99
Scopes in BPEL
<scope


Provide a shared
context for subset of
activities
Can contain





fault handlers
event handlers,
compensation handler
variables
correlation sets
Can serialize
concurrent
access to variables
3/14/2016
variableAccessSerializable="yes|no“
...>
<variables>
</variables>
<correlationSets>? ...
</correlationSets>
<faultHandlers>
</faultHandlers>
<compensationHandler>? ...
</compensationHandler>
<eventHandlers>
</eventHandlers>
(activities)*
</scope>
100
Long Running Transactions
and Compensation
<scope>
Charge
Hold Fee
Undo
CreditService
• CheckCredit
• ChargeHoldFee
• CancelHoldFee
InventoryService
Reserve
Inventory Undo
• ReserveInventory
• CancelReserveInv
</scope>
3/14/2016
101
Compensation Handlers
in BPEL
<scope>
<compensationHandler>
<invoke partnerLink="Seller" portType="SP:Purchasing"
operation="CancelPurchase"
inputVariable="getResponse"
outputVariable="getConfirmation">
<correlations>
<correlation set="PurchaseOrder" pattern="out"/>
</correlations>
</invoke>
</compensationHandler>
<invoke partnerLink="Seller" portType="SP:Purchasing"
operation="SyncPurchase"
inputVariable="sendPO"
outputVariable="getResponse">
<correlations>
<correlation set="PurchaseOrder" initiate=“yes”
pattern="out"/>
</correlations>
</invoke>
</scope>
3/14/2016
102
Exception Handling in BPEL

<faultHandlers> catch exception

Based on WSDL port defining fault
<faultHandlers> can perform activities upon
invocation

<faultHandlers>
<catch faultName="lns:cannotCompleteOrder"
faultVariable="POFault">
<reply partnerLink="customer"
portType="lns:purchaseOrderPT"
operation="sendPurchaseOrder"
variable="POFault"
faultName="cannotCompleteOrder"/>
</catch>
</faultHandlers>
3/14/2016
103
Just Show Me How to Do it!
Process
WSDL
Partner
WSDL 1
...
Partner
WSDL n
3/14/2016
BPEL Scenario
<process>
<partners>
<variables>
<sequence>
<flow>
</sequence>
</process>
1. Compile
2. Package
3. Deploy
Compiled
BPEL Scenario
BPEL Runtime
Application
Server
104
Tooling Requirements








IDE – build your Web services
WSDL authoring – model your interfaces
Schema authoring – model your messages
Process modeling – model your orchestration
Packaging and deployment
Debugging
Monitoring
Analyzing
3/14/2016
105
Roadmap






Web Services Stack
SOAP
WSDL
UDDI
Web Services Composition - BPEL
Issues
3/14/2016
106
Remember BPEL Does
Not Solve “World Hunger”







No data transformation
No data translation
No human workflow
No trading partner agreements
Silent on existing business protocols (ebXML,
RosettaNet …)
Silent on non Web service interactions (e.g. java to
java)
...
3/14/2016
107
But Remember: People Are
Trying to Solve “World Hunger”









W3C: WS-Choreography
Spec: WS-Transaction
Spec: WS-Coordination
Spec: WS-Composite Application Framework
OASIS: WS-Reliability
Spec: ReliableMessaging
Spec: WS-Addressing
OASIS: WS-Security
…
3/14/2016
108
Parting Thoughts

Business process portability?



Programming language in XML?


Java/J2EE is portable across application servers
BPEL is portable independent of Java
Vendors, big and small, are busy building design
times and modelers…
Is BPEL in 2003/2004 J2EE in 1998?

3/14/2016
Much missing but compelling foundation
109
Problems



Complex long running web services.
Analysis and verification
Automatic composition of complex services.
…
3/14/2016
110
Web Services and the Semantic
Web

Complementary Goals

Semantic Web


Web Services

3/14/2016
It’s about making links between information more
intelligent.
It’s about improving the way information is exchanged
111
Web Services and the Semantic
Web

Meeting in the middle

Semantic Web


Transactional Web

3/14/2016
Provides a formal data-model for Web Services
Provides a technology foundation for the Semantic
Web
112
Research topics


Searching for web services
Searching for sequence of web services



Output of one is input to other
Schema matching
Trust
3/14/2016
113
References





James Snell slides, IBM
Andrew Siegel, UChicago
Xiang Fu slides
Katharina Siorpaes slides
Oracle
3/14/2016
114
References
•
•
•
•
•
3/14/2016
V.d. Aalst, W.M.P., Dumas, M., ter Hofstede, A.H.M., Wohed,
P. (2002) Pattern-based analysis of BPML (and WSCI),
http://xml.coverpages.org/Aalst-BPML.pdf
Cabera, F., Copeland, G., Freund, T., Klein J., Langworthy D.,
Orchard, D., Shewchuk, J., Storey, T. (2002) Web Service
Coordination (WS-Coordination), http://www106.ibm.com/developerworks/library/ws-coor/, 2002
Leymann, F. (2001) Web Services Flow Language (WSFL1.0),
http://www306.ibm.com/software/solutions/webservices/pdf/WSFL.pdf
Arkin, A., (2002) Business Process Modeling Language,
Arkin, A., Askary, S., Fording, S., Jekeli, W., Kawaguchi, K.,
Orchard, D., Pogliani, S., Riemer, K., Struble, S., TakacsiNagy, P., Trickovic, I., Zimek, S. (2002) Web Service
Choreography Interface 1.0
115
Download