+ All Categories
Home > Documents > Stateful services & service orchestration

Stateful services & service orchestration

Date post: 04-Feb-2022
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
47
Stateful services & service orchestration Technology overview & PhD status report Andreas Duscher
Transcript

Stateful services &

service orchestration

Technology overview &

PhD status report

Andreas Duscher

2

Table of Contents

� Part I

� PhD thesis

� Part II

� Web Services Resource Framework (WSRF)

� WS-Addressing

� Part III

� WS-BPEL

� Part IV

� Current & future work

3

Part I

PhD thesis

4

Problem Domain

� Computer algebra systems or theorem provers arestandalone systems with interfaces for human users

� Mathematical web services operate in a semanticallyrich domain� often require an intensive dialog between a client and

a service� a sequence of messages according to a protocol has

to be exchanged� writting these interaction protocols manually is

timeconsuming

5

Vision

Differentiate

polynomial 2x² + 3x

and return result in

MathML notation

ask for possible

solutions

Middleware

6

Vision

ask for possible

solutions

Theorem Prover

Computer Algebra System

Middleware

Semantic

Descriptions

Transformation Services

7

Vision

ask for possible

solutions

Theorem Prover

Computer Algebra System

Middleware

Semantic

Descriptions

Differentiate

polynomial 2x² + 3x

and return result in

MathML notation

Transformation Services

Possible scenario

1. A matching differentiation service

exists, but only provides

OpenMath objects.

2. So a transformation service is

needed.

3. Moreover the differentiation

service has some pre- and

postconditions.

• create an instance

• execute

• terminate the instance

8

Vision

ask for possible

solutions

Theorem Prover

Computer Algebra System

Middleware

Semantic

Descriptions

ask for more

information

provide a result

Differentiate

polynomial 2x² + 3x

and return result in

MathML notation

Transformation Services

9

Architecture

Computer

Algebra System

Web Service 2

Web Service 3

Theorem ProverWeb Service 1

Client

Middleware

MathBroker

Processmodels

Semanticdescriptions

query

Registry

publish web service interfaces

provide result or

ask for more

information

execute process model

Web Service 4

10

Architecture

Computer

Algebra System

Web Service 2

Web Service 3

Theorem ProverWeb Service 1

Client

Middleware

MathBroker

Processmodels

Semanticdescriptions

query

Registry

publish web service interfaces

provide result or

ask for more

information

execute process model

Web Service 4

11

Part II

WSRF

WS-Addressing

12

Web Services architecture

� Web services broadly accepted standard fordistributed software

� Basic technologies (SOAP and WSDL)

<SOAP:Envelopexmlns="http://schemas.xmlsoap.org/soap/envelope/"

<SOAP:Header> ... </SOAP:Header>

<SOAP:Body>

</SOAP:Body>

</SOAP:Envelope>

13

Web Services architecture

WSDL

Interface

Resources (DB,

FS, CAS)

Incoming and

outgoing messages

Web service

implementation

Web service

application server

14

Web Services architecture

� Web services make a request, may

get a response and then disconnect

� each request is independent of the

previous request

� no session or state management

"Web services are stateless"

� states are needed for ensuring further

interoperability among services

Problem

15

Web Services architecture

��� Web Web Web servicesservicesservices makemakemake a a a requestrequestrequest, , , maymaymay

getgetget a a a responseresponseresponse and and and thenthenthen disconnectdisconnectdisconnect

��� eacheacheach requestrequestrequest isisis independent of independent of independent of thethethe

previouspreviousprevious requestrequestrequest

��� no no no sessionsessionsession ororor statestatestate managementmanagementmanagement

"Web "Web "Web servicesservicesservices areareare statelessstatelessstateless"""

��� statesstatesstates areareare neededneededneeded forforfor ensuringensuringensuring furtherfurtherfurther

interoperabilityinteroperabilityinteroperability amongamongamong servicesservicesservices

Problem

Theorem Prover

Computer Algebra System

Middleware

Semantic

Descriptions

Transformation Services

16

Web Services architecture

� stateful resource

• „… something that exists, even if you are

not interacting with it.“

• file in the file system, a database, a

computer algebra system

� relation between Web services and

stateful resources is needed

� possibility of specifying a resource

and its properties

Approach

17

Web Services Resource

Framework (WSRF)

� WSRF „a generic and openframework for modeling and accessing stateful resources usingWeb services“Definition taken from http://www.oasis-open.org/committees/wsrf

� actual series of specifications thatdefine standard „message patterns“

� builds on existing standards (SOAP and WSDL)

18

Web Services Resource

Framework (WSRF)

� WS-ResourceProperties (WSRF-RP)

� specifies the form in which resource properties aredefined in a WSDL file

� specifies the form of messages that request and receive properties

� WS-ResourceLifetime (WSRF-RL)

� specifies how to define expiration or resourcedestroyment

� WS-ServiceGroup (WSRF-SG)

� defines a way to create collections of services

� WS-BaseFaults (WSRF-BF)

� specifies a standard way of error handling

19

Web Services Addressing

(WS-Addressing)

� in SOAP

� no standarized way of specifying

additional metadata about a web

service

� no standarized way of specifying

information about a web service

location

� message information headers

� endpoint references

20

WS-Addressingmessage information header

� allows to specifiy additional information about a web serviceother than its endpoint address

� e.g. message ids, reply addresses, special actions<SOAP:Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">

<SOAP:Header>

<wsa:MessageID>uuid:6B29FC40-CA47-1067-B31D-00DD010662DA</wsa:MessageID>

<wsa:ReplyTo>

<wsa:Address> http://localhost:8080/wsrf/services/OtherServicePort</wsa:Address>

</wsa:ReplyTo>

<wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/GapPort</wsa:To>

<wsa:Action mustUnderstand="1">

http://localhost:8080/wsrf/services/GapPort

</wsa:Action>

</SOAP:Header>

<SOAP:Body> … </SOAP:Body>

</SOAP:Envelope>

21

WS-Addressingendpoint reference

CB

A

<wsa:EndpointReference>

<wsa:Address>http://localhost:8080/wsrf/services/GapPort</wsa:Address>

<wsa:ReferenceProperties>

<gap:ResourceIdentifier>A</gap:ResourceIdentifier>

</wsa:ReferenceProperties>

</wsa:EndpointReference>

� a specified way for

describing a web service

endpoint

22

Example: How it fits together

CB

A

<wsdl:definitions

targetNamespace="http://risc.uni-linz.ac.at/services/gap"

xmlns="http://schemas.xmlsoap.org/wsdl/"

xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"

xmlns:gap-pr="http://risc.uni-linz.ac.at/services/gap/gap-properties.xsd"

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

<wsdl:portType name="GapPortType"

wsrf-rp:ResourceProperties="gap-pr:GapResourceProperties">

<wsdl:operation …

</wsdl:portType>

<xsd:element

name="GapResourceProperties">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="gap-pr:Reference" />

<xsd:element ref="gap-pr:State" />

<xsd:element ref="gap-pr:LastAction" />

<xsd:element ref="wsrf-rl:CurrentTime" />

<xsd:element ref="wsrf-rl:TerminationTime" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

• Define properties of stateful

resource

• Specify them in the WSDL

document

23

Example: How it fits together

CB

A

Service

Requestor

Obtain a resource

24

Example: How it fits together

CB

A

Service

Requestor

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"

xmlns:gap="http://risc.uni_linz.ac.at/services/gap"

xmlns:gap-pr="http://risc.uni-linz.ac.at/services/gap/gap-properties.xsd">

<Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">

<wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/GapPort</wsa:To>

<wsa:Action mustUnderstand="1">http://localhost:8080/wsrf/services/GapPort</wsa:Action>

</Header>

<Body>

<gap-pr:CreateInstanceRequest/>

</Body>

</Envelope>

25

Example: How it fits together

CB

A

Service

Requestor

<Envelope>

<Header>

<wsa:MessageID soapenv:mustUnderstand="0">uuid:6b70efd0-5109-11da-bee5-97c796a68843</wsa:MessageID>

<wsa:To soapenv:mustUnderstand="0">http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>

<wsa:Action soapenv:mustUnderstand="0">http://localhost:8080/wsrf/services/GapPortResponse</wsa:Action>

<wsa:From soapenv:mustUnderstand="0">

<wsa:Address>http://localhost:8080/wsrf/services/GapPort</wsa:Address>

</wsa:From>

</Header>

</Envelope>

26

Example: How it fits together

CB

A

Service

Requestor

<Envelope>

<Body>

<gap-pr:CreateInstanceResponse>

<wsa:Address>http://10.0.1.2:8080/wsrf/services/GapPort</wsa:Address>

<wsa:ReferenceProperties>

<gap:ResourceIdentifier>A</gap:ResourceIdentifier>

</wsa:ReferenceProperties>

<wsa:PortType>gap:GapPortType</wsa:PortType>

<wsa:ServiceName PortName="GapPort"/>

</gap-pr:CreateInstanceResponse>

</Body>

</Envelope>

endpoint reference

27

Example: How it fits together

CB

A

Service

Requestor

Access the created resource

28

Example: How it fits together

CB

A

Service

Requestor

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd"

xmlns:gap="http://risc.uni_linz.ac.at/services/gap"

xmlns:gap-pr="http://risc.uni-linz.ac.at/services/gap/gap-properties.xsd">

<Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">

<wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/GapPort</wsa:To>

<wsa:Action mustUnderstand="1">http://localhost:8080/wsrf/services/GapPort</wsa:Action>

<gap:ResourceIdentifier>A</gap:ResourceIdentifier>

</Header>

<Body>

<wsrf-rp:GetResourcePropertyDocument/>

</Body>

</Envelope>

29

Example: How it fits together

CB

A

Service

Requestor

<Body>

<wsrf:GetResourcePropertyDocumentResponse

xmlns:wsrf="http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd">

<gap:GapResourceProperties xmlns:gap="http://risc.uni-linz.ac.at/services/gap/gap-properties.xsd">

<wsrf:CurrentTime>2005-11-09T11:12:51.056+01:00</wsrf:CurrentTime>

<wsrf:TerminationTime />

<gap:State>ready</gap:State>

<gap:LastAction>no action</gap:LastAction>

<gap:Reference>

</gap:Reference>

</gap:GapResourceProperties>

</wsrf:GetResourcePropertyDocumentResponse>

</Body>

<xsd:element

name="GapResourceProperties">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="gap-pr:Reference" />

<xsd:element ref="gap-pr:State" />

<xsd:element ref="gap-pr:LastAction" />

<xsd:element ref="wsrf-rl:CurrentTime" />

<xsd:element ref="wsrf-rl:TerminationTime" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

30

Part III

WS-BPEL

31

Web Services architecture

� current standards (e.g. SOAP and

WSDL) only allow to define the

services' message protocols and its

static interfaces

� no built-in orchestration mechanisms

"Web services are standalone"

� composition of services to a new

service not possible

Problem

32

Web Services architecture

� relations between involved services

has to be definied (e.g. message

exchange patterns, case distinctions,

error handling)

� constructs known form higher

programming languages

� language for "process modeling"

Approach

33

WS-BPEL (Web Services

Business Process ExecutionLanguage)� What is WS-BPEL?

� an XML grammar for web services orchestration that relies on current standards

� What does WS-BPEL?� reacting to message reception, manipulating the message data,

sending messages to web services and evaluating expressions

� Where does it come from?� by IBM, BEA Systems and Microsoft (BPEL4WS)

� Siebel and SAP joined these three and the specification has beedonated to OASIS

� Where does WS-BPEL fit?� encapsulate the cross-service business logic

� introduction of long-living transactions

34

WS-BPEL syntax

� Basic activities

��� variable/variable/variable/assignassignassign

��� receivereceivereceive

��� invokeinvokeinvoke

��� replyreplyreply

� Structured activities

��� sequencesequencesequence

��� switchswitchswitch

��� whilewhilewhile

��� flowflowflow

35

WS-BPEL syntax

� Basic activities

� variable/assign

��� receivereceivereceive

��� invokeinvokeinvoke

��� replyreplyreply

��� StructuredStructuredStructured activitiesactivitiesactivities

��� sequencesequencesequence

��� switchswitchswitch

��� whilewhilewhile

��� flowflowflow

<variables>

<variable name="input" messageType="gap:Request" />

<variable name="output" messageType="xsd:int" />

<variable name="cond" messageType="gap:Condition" />

</variables>

….

<assign>

<copy>

<from variable="input" query=“/gap:Argument” />

<to variable=“cond" query=“/gap:String" />

</copy>

</assign>

….

<assign>

<copy>

<from>5000</from>

<to variable=“output"/>

</copy>

</assign>

36

WS-BPEL syntax

� Basic activities

��� variable/variable/variable/assignassignassign

� receive

��� invokeinvokeinvoke

��� replyreplyreply

��� StructuredStructuredStructured activitiesactivitiesactivities

��� sequencesequencesequence

��� switchswitchswitch

��� whilewhilewhile

��� flowflowflow

<receive portType="initiatorPT" operation="initiate"

variable="input"

createInstance="yes"/>

� usually first activity in a WS-BPEL process

� WS-BPEL process acts like a web service

37

WS-BPEL syntax

� Basic activities

��� variable/variable/variable/assignassignassign

��� receivereceivereceive

� invoke

��� replyreplyreply

��� StructuredStructuredStructured activitiesactivitiesactivities

��� sequencesequencesequence

��� switchswitchswitch

��� whilewhilewhile

��� flowflowflow

<invoke partnerLink="gapService"

portType="gap:GapPort" operation="executeAction"

inputVariable="action“

outputVariable=“response“ />

� invokes a definied web service

� uses an input variable for invocation

� results are stored in an output variable

38

WS-BPEL syntax

� Basic activities

��� variable/variable/variable/assignassignassign

��� receivereceivereceive

��� invokeinvokeinvoke

� reply

��� StructuredStructuredStructured activitiesactivitiesactivities

��� sequencesequencesequence

��� switchswitchswitch

��� whilewhilewhile

��� flowflowflow

<reply portType="finisherPT" operation="finish"

variable="result" />

� usually the last command of a structured activity

or a process

39

WS-BPEL syntax

��� Basic Basic Basic activitiesactivitiesactivities

��� variable/variable/variable/assignassignassign

��� receivereceivereceive

��� invokeinvokeinvoke

��� replyreplyreply

� Structured activities

� sequence

��� switchswitchswitch

��� whilewhilewhile

��� flowflowflow

<sequence>

<receive …. />

<invoke …. />

<reply …. />

</sequence>

� executes a set of activities in an order

40

WS-BPEL syntax

<case condition="bpws:getVariableData('response','Integer')&lt;10000">

<assign>

<copy>

<from>5000</from>

<to variable="cond" part="String"/>

</copy>

</assign>

</case>

<otherwise>

<assign>

<copy>

<from>15000</from>

<to variable="cond" part="String"/>

</copy>

</assign>

</otherwise>

</case>

� based on a condition, a set of activities will be

executed

��� Basic Basic Basic activitiesactivitiesactivities

��� variable/variable/variable/assignassignassign

��� receivereceivereceive

��� invokeinvokeinvoke

��� replyreplyreply

� Structured activities

��� sequencesequencesequence

� switch

��� whilewhilewhile

��� flowflowflow

41

WS-BPEL syntax

<variables>

<variable name=“loopVar” type=“gap:loopVarType”>

</variables>

<while condition=“10 > bpws:getVariableData(loopVar',‘main')">

<assign>

<copy>

<from expression=“bpws:getVariableData(loopVar',‘main') + 1”>

<to variable=“loopVar” part=“main”>

</copy>

</assign>

</while>

� repeats an activity depending on

certain conditions

��� Basic Basic Basic activitiesactivitiesactivities

��� variable/variable/variable/assignassignassign

��� receivereceivereceive

��� invokeinvokeinvoke

��� replyreplyreply

� Structured activities

��� sequencesequencesequence

��� switchswitchswitch

� while

��� flowflowflow

42

WS-BPEL syntax

<flow

<sequence>

</sequence>

<sequence>

</sequence>

<sequence>

</sequence>

</flow>

� executes one or more activities concurrently

��� Basic Basic Basic activitiesactivitiesactivities

��� variable/variable/variable/assignassignassign

��� receivereceivereceive

��� invokeinvokeinvoke

��� replyreplyreply

� Structured activities

��� sequencesequencesequence

��� switchswitchswitch

��� whilewhilewhile

� flow

43

Limitations

� dynamic discovery and binding of

partern services is not possible

� dynamic concurrent processes are not

supported

� no explicit transaction support in the

XML grammar

� at the moment only the open source

engine Twister supports WS-BPEL

44

Part IV

Current & future work

45

Current work

GAP

Web Service 2

Web Service 3

Web Service 1

Client

Middleware

MathBroker

Processmodels

Semanticdescriptions

query

Registry

publish web service interfaces

provide result or

ask for more

information

execute process model

WS-BPEL

WSRF

Twister Engine

MSDL

stateful resource

Web Service 4

46

Future work

GAP

Web Service 2

Web Service 3

Web Service 1

Client

Middleware

MathBroker

Processmodels

Semanticdescriptions

query

Registry

publish web service interfaces

provide result or

ask for more

information

execute process model

Twister Engine

automated

process model

creation

Web Service 4

47

Bibliography

� WSRFhttp://www.oasis-open.org/committees/wsrf

� WS-Addressinghttp://www.w3.org/Submission/ws-addressing/

� WS-BPELhttp://www.oasis-open.org/committees/wsbpel


Recommended