115
Web Services Vagelis Hristidis FIU

Web Services Vagelis Hristidis FIU. 9/11/20152 What is the “Transactional Web” Today: “The eye-ball Web” - the architecture of the Web is geared towards

Embed Size (px)

Citation preview

Web Services

Vagelis Hristidis

FIU

04/19/23 2

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.

04/19/23 3

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.

04/19/23 4

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,

04/19/23 5

WSAH(Web Services Acronym Hell)

XML

SOAP

WSDL

UDDIWSFL

DISCO

PKIXKMS

SAML

ebXML

XML-RPC

XMLP

XML-DIGSIG

XML-ENCSOAP-

SEC

X-KISS

CPP-CPA

WSEL

SOAP-RP

DIME

XLANG

DISCO

JABBER

P3P

DSML

DAML-S

XSD

BPEL

04/19/23 6

Roadmap

Web Services Stack SOAP WSDL UDDI Web Services Composition - BPEL Issues

04/19/23 7

The Web Services Stack

Wire Protocols

Description 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”

04/19/23 8

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

04/19/23 9

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

04/19/23 10

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

04/19/23 11

Web Services Stack

Description

HTTP,IIOP, JMS, SMTP Transport

XMLMessage

SOAP

WSDL

UDDI Discovery

Transactions

CoordinationWS-SecurityWS-ReliabilityQuality ofService

Orchestration - BPEL4WS

BusinessProcesses

Context

Description

Man

agem

ent

Choreography - CDL4WS

04/19/23 12

Roadmap

Web Services Stack SOAP WSDL UDDI Web Services Composition - BPEL Issues

04/19/23 13

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

04/19/23 14

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

04/19/23 15

General (Basic) Structure SOAP Message

Envelope Defines the content of

the message Header (optional)

Contains destination information, versioning, extensions

Good place for security Body

Contains payload

SOAP Envelope

SOAP Header

SOAP Body

Payload Document(s)

SOAP Fault

04/19/23 16

General (Basic) Structure SOAP Message

<soap:Envelopexmlns:soap="http://schemas.xmlsoap.org/soap/encoding/"soap:encodingStyle="http://schemas.xmlsoap.org/soap/

encoding/">

<soap:Header>... ...

</soap:Header><soap:Body>

<!-- User request code here --><soap:Fault>

... ...</soap:Fault>

</soap:Body></soap:Envelope>

04/19/23 17

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>

04/19/23 18

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.

04/19/23 19

SOAP RPC cartoon

VB application

InvoiceVB-Structure

SOAP client

SOAP Server

InvoiceJava-Structure

Java application

SOAP Message

The client application thinks its making a procedure call to a remote module

04/19/23 20

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. http is most popular

04/19/23 21

Roadmap

Web Services Stack SOAP WSDL UDDI Web Services Composition - BPEL Issues

04/19/23 22

Source

WSDL 1.1 specification http://www.w3.org/TR/wsdl

WSDL 2.0 working draft, 26 June 2007 http://www.w3.org/TR/wsdl20/

W3C School Tutorial http://www.w3schools.com/wsdl/wsdl_intro.asp

04/19/23 23

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.

Version 1.1 released March 2001 W3C Recommendation of Version 2.0 released June

2007

04/19/23 24

Related Standards

Type System: XML Schema Name space: XML namespaces Binding: SOAP, HTTP, MIME and etc.

04/19/23 25

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>

04/19/23 26

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” />

</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

04/19/23 27

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.

04/19/23 28

<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>

04/19/23 29

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.

04/19/23 30

<message name="GetLastTradePriceInput"> <part name="body" element="TradePriceRequest"/>

</message>

<message name="GetLastTradePriceOutput"> <part name="body" element="TradePrice"/>

</message>

04/19/23 31

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.

04/19/23 32

<portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetLastTradePriceInput"/> <output message="tns:GetLastTradePriceOutput"/> </operation> </portType>

04/19/23 33

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 additionrequest – multiple response …

04/19/23 34

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 >

04/19/23 35

Binding

Binding defines how message are transmitted, and the location of the service.

04/19/23 36

<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>

04/19/23 37

<service name="StockQuoteService"> <documentation>My first service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location="http://example.com/stockquote"/> </port> </service>

04/19/23 38

Roadmap

Web Services Stack SOAP WSDL UDDI Web Services Composition - BPEL Issues

04/19/23 39

WSDL and UDDI

Description of web service. Discovery of web service? UDDI – yellow page.

04/19/23 40

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

04/19/23 41

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.

04/19/23 42

UDDI Overview

UDDI is built around a “Yellow-pages” like data model:

Business Entity

Business Services

Service Bindings

Categories

Identities

TModels

04/19/23 43

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

04/19/23 44

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.

04/19/23 45

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.

04/19/23 46

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

04/19/23 47

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)

04/19/23 48

WSDL in UDDI

WSDL UDDI

04/19/23 49

WSDL in UDDI

Since the service interface represents a reusable definition of a service, it is published in a UDDI registry as a tModel

04/19/23 50

WSDL in UDDI

04/19/23 51

Roadmap

Web Services Stack SOAP WSDL UDDI Web Services Composition - BPEL Issues

04/19/23 52

Web Services Stack

Description

HTTP,IIOP, JMS, SMTP Transport

XMLMessage

SOAP

WSDL

UDDI Discovery

Transactions

CoordinationWS-SecurityWS-ReliabilityQuality ofService

Orchestration - BPEL4WS

BusinessProcesses

Context

Description

Man

agem

ent

Choreography - CDL4WS

04/19/23 53

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

04/19/23 54

Web Services Meet Business Processes

Web Service 1

Web Service 2

Web Service 3

Web Service 4

Web Service 5

Web Service n

04/19/23 55

Example Problem Space

ClientPO Service

Credit Service

Inventory Service

Purchase Order

Credit

Check

ReserveInventory

Credit

Response

InventoryResponse

InvoiceConsolidate

Results

04/19/23 56

Business Process Challenges

Coordinate asynchronous communication between services

Correlate message exchanges between parties

Implement parallel processing of activities

. . .

Manipulate/transform data between partner interactions

Support for long running business transactions and activities

Provide consistent exception handling

. . .

04/19/23 57

Recent History of Business Process Standards

2000/05

XLang(Microsoft)

2001/03

BPML(Intallio et al)

2001/05

WSFL(IBM)

2001/06

BPSS(ebXML)

2002/03

BPEL4WS 1.0 (IBM, Microsoft)

BPEL4WS 1.1(OASIS)

2002/06 2003/01

WS-Choreography(W3C)

2003/04

WSCI(Sun et al)

WSCL(HP)

2002/08

BPEL4WS 2.0(OASIS)

2007

04/19/23 58

Orchestration vs Choreography

Orchestration An executable business process describing a flow

from the perspective and under control of a single endpoint (commonly: Workflow)

Choreography The observable public exchange of messages,

rules of interaction and agreements between two or more business process endpoints

04/19/23 59

Sample Business Process: Purchase Order

Sample Purchase Order

Purchase Order Request

Purchase Order Acknowledgement

Purchase Order Response

Business

“A”Business “B”

04/19/23 60

From a Choreography Perspective

PO Request

Send PO

Receive PO Ack

Receive PO Response

Receive PO

Send PO Ack

Send PO Response

PO Acknowledgement

PO Response

Choreography – The observable public exchange of messages

Public Process

Business A Business B

04/19/23 61

From an Orchestration Perspective

Send PO

Receive PO Ack

Receive PO Response

Transform

Transform

From ERP

To ERP

PO Request

PO Acknowledgement

PO Response

Orchestration – A private executable business process

Private Process

Business A BPEL Workflow

04/19/23 62

Orchestration and Choreography Together

BusinessB

Business Analyst Tool

BusinessA

Send PO

Receive PO Ack

Receive PO Response

Transform

Transform

Business A BPEL Workflow

PO Request

PO Acknowledgement

PO Response

Generate BPEL Template

Generate BPEL Template

Receive PO

Send PO Ack

Receive PO Response

Transform

Transform

Business B BPEL Workflow

Two BPEL workflow templates reflecting a business agreement

04/19/23 63

WSFL

Web Service Flow Language By IBM To fit into the WS Stack naturally

XML-based grammar to describe WS interactions

04/19/23 64

Multi-party business processes

Operational description

WSDL (Web Service Description Language)

Composition and choreography of WS

WSFL (Web Service Flow Language)

04/19/23 65

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

04/19/23 66

Flow Composition in WSFL (II)

Business tasks Control flow Data flow

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

04/19/23 67

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 Peer-to-peer interactions Hierarchical interactions

A

B

C

04/19/23 68

Web Services Stack

Description

HTTP,IIOP, JMS, SMTP Transport

XMLMessage

SOAP

WSDL

UDDI Discovery

Transactions

CoordinationWS-SecurityWS-ReliabilityQuality ofService

Orchestration - BPEL4WS, BPML

BusinessProcesses

(WS Composition)

Context

Description

Man

agem

ent

Choreography - CDL4WS, WSCI

04/19/23 69

BPML/WSCI

Complementary efforts Business Process Model Language (Orchestration)

describes executable business processes private

Web Services Choreography Interface describes messages between collaborating web services XML-based language for WS collaboration Public interactions and choreographies between services

04/19/23 70

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

04/19/23 71

BPML – 5 elements

Activitiesperformance of simple or complex functions

Processestypes of complex activities that define its own context

Contextsenvironment for the execution of activities

Propertiesinformation exchange within a context

Signalscoordination of activities

04/19/23 72

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

04/19/23 73

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

Each WSCI unit of work WSDL operation WSDL: entry points of each service WSCI: interactions among WSDL operations

04/19/23 74

WSCI – key features (I)

Support for basic activities: each activity specifies the WSDL operation

involved use <action> to define a basic request/response

message use <call> to invoke external services

04/19/23 75

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: transactional contexts can be defined in WSCI any failure in a context will result in all

transactions in context being rolled back

04/19/23 76

WSCI – concepts (I)

InterfaceObservable behaviour of a WS in a message

exchange with other WS Activities

Basic unit of behaviour; either atomic or complex (composed of other activities)

ProcessesTop-level processes and nested processes

PropertiesReference a value within an IF definition

04/19/23 77

WSCI – concepts (II)

ContextEnvironment: a set of activities is executed

Message correlationStructure of conversations, management of multiple

conversations with the partner

Exceptional behaviourAlternative patterns of behaviour; association to activities

Transactional behaviour Global model

Overall message exchange

04/19/23 78

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

04/19/23 79

BPEL4WS – BPML

BPML and BPEL4WS are both block-structured 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

04/19/23 80

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

04/19/23 81

BPEL4WS – BPLM/WSCI

BPEL4WSAbstractProcesses

WSCI

BPEL4WSExecutableProcesses

BPML

BPEL4WS(IBM, Microsoft, BEA)

WSCI/ BPML(Sun, Intalio, SAP)

ColloborativeProtocols

ExecutableBusinessProcesses

04/19/23 82

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• IBM, Microsoft, Oracle, Sun, BEA, SAP, Siebel …

04/19/23 83

Value Proposition

Portable business processes Built on top of an interoperable infrastructure of

Web services Industry wide language for business

processes Common skill set and language for developers

Choice of process engines Standards lead to competitive offerings

04/19/23 84

Standards Building Blocks of BPEL

Description

HTTP,IIOP, JMS, SMTP Transport

XMLMessage

SOAP

WSDL

UDDI Discovery

Transactions

CoordinationWS-SecurityWS-ReliabilityQuality ofService

Orchestration - BPEL4WS

BusinessProcesses

Context

Description

Man

agem

ent

Choreography - CDL4WS

04/19/23 85

BPEL Depends on WSDL and WSDL Extensions

Service Implementation

Definition

Service Interface Definition

Service

Port

Binding

Port types define Operations

Message

Type

04/19/23 86

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>

04/19/23 87

BPEL Activities

Primitive Activities <invoke> <receive> <assign> <reply> <throw> <terminate> <wait>

Structured Activities <sequence> <switch> <pick> <flow> <link> <while> <scope>

04/19/23 88

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

CreditService

Partner 2

InventoryService

Partner 3Partner 1(the process)

PurchaseService

04/19/23 89

Partners in 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>

<plt:partnerLinkType name=“purchasePLT”> <plt:role name=“purchaseService”> <plt:portType name=“tns:purchasePT”/> </plt:role></plt:partnerLinkType>

Purchase Process WSDL:

BPEL:

<portType name=“purchasePT”> <operation name="sendPurchase"> </operation></portType>

Purchase Process PortType:

04/19/23 90

Variables

Messages sent and received from partners Persisted for long running interactions Defined in WSDL types and messages

CustomerService

Process

<A>

<variable> <activity>

<B>

<activity>

PersistPersist/Retrieve

CustomerService

Persist/Retrieve

Persist/Retrieve

<variable>

04/19/23 91

Variables in BPEL

<variables> <variable name=“PO” messageType=“lns:POMessage”/> <variable name=“Invoice” messageType=“lns:InvMessage”/> <variable name=“POFault” messageType=“lns:orderFaultType”/></variables>

<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>

Purchase Process WSDL:

BPEL:

04/19/23 92

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>

04/19/23 93

Simple Activities Receive

Wait for a partner inbound message Can be the instantiator of the business process

Reply Synchronous response to a receive activity Response to the inbound receive from a partner

Invoke Issue a request synchronously *or* asynchronously

04/19/23 94

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. The pick activity awaits the occurrence of one of a

set of events and then performs the activity associated with the event that occurred

04/19/23 95

Simple Activities Combined with Structured Activities

Invoke <InventoryService> Invoke <CreditService>

Reply <Invoice>

Receive <PO> <sequence>

<flow>

</sequence>

04/19/23 96

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>

04/19/23 97

<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>

<flow>

</flow>

<Y>

<C>

<E>

<X>

<A>

<B>

<D>

<link CtoD>

Links – Control Flow

<link XtoY>

04/19/23 98

Correlation

Customer

• SendPurchase

• ProcessPurchaseResponse

PO

Correlation:<PO_CustId = 10><PO_OrdId = 100>

POResponse

Correlations:<PO_CustId = 10><PO_OrdId = 100>

<Inv_VendId = 20><Inv_InvId = 200>

Seller

• AsynchPurchase

• AsynchPurchaseResponse

initiate=yes

initiate=yes pattern=out

initiate=no pattern=out

initiate=yes

initiate=yes

initiate=no

04/19/23 99

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> ...

04/19/23 100

Scopes in BPEL

Provide a shared context for subset of activities

Can contain fault handlers event handlers, compensation handler

variables correlation sets

Can serialize concurrentaccess to variables

<scopevariableAccessSerializable="yes|no“ ...>

<variables></variables>

<correlationSets>? ... </correlationSets>

<faultHandlers></faultHandlers>

<compensationHandler>? ... </compensationHandler>

<eventHandlers></eventHandlers> (activities)*

</scope>

04/19/23 101

Long Running Transactions and Compensation

Undo

ReserveInventory

<scope>

</scope>

• ReserveInventory• CancelReserveInv

InventoryService

• CheckCredit• ChargeHoldFee• CancelHoldFee

CreditService

Undo

ChargeHold Fee

04/19/23 102

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>

04/19/23 103

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>

04/19/23 104

Just Show Me How to Do it!

PartnerWSDL 1

ProcessWSDL

PartnerWSDL n

. . .

BPEL Scenario

<process> <partners> <variables> <sequence> <flow> </sequence></process>

1. Compile2. Package3. Deploy

ApplicationServer

BPEL Runtime

CompiledBPEL Scenario

04/19/23 105

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

04/19/23 106

Roadmap

Web Services Stack SOAP WSDL UDDI Web Services Composition - BPEL Issues

04/19/23 107

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) . . .

04/19/23 108

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 …

04/19/23 109

Parting Thoughts

Business process portability? Java/J2EE is portable across application servers BPEL is portable independent of Java

Programming language in XML? Vendors, big and small, are busy building design

times and modelers… Is BPEL in 2003/2004 J2EE in 1998?

Much missing but compelling foundation

04/19/23 110

Problems

Complex long running web services. Analysis and verification Automatic composition of complex services.

04/19/23 111

Web Services and the Semantic Web

Complementary Goals Semantic Web

It’s about making links between information more intelligent.

Web Services It’s about improving the way information is exchanged

04/19/23 112

Web Services and the Semantic Web

Meeting in the middle Semantic Web

Provides a formal data-model for Web Services Transactional Web

Provides a technology foundation for the Semantic Web

04/19/23 113

Research topics

Searching for web services Searching for sequence of web services

Output of one is input to other Schema matching Trust

04/19/23 114

References

James Snell slides, IBM Andrew Siegel, UChicago Xiang Fu slides Katharina Siorpaes slides Oracle

04/19/23 115

References

• 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://www-106.ibm.com/developerworks/library/ws-coor/, 2002

• Leymann, F. (2001) Web Services Flow Language (WSFL1.0), http://www-306.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., Takacsi-Nagy, P., Trickovic, I., Zimek, S. (2002) Web Service Choreography Interface 1.0