• Aucun résultat trouvé

orchestrations Interaction safety in Web service

N/A
N/A
Protected

Academic year: 2022

Partager "orchestrations Interaction safety in Web service"

Copied!
45
0
0

Texte intégral

(1)

Interaction safety in Web service orchestrations

Jonathan Michaux 6/11/2012

Just sessionize it !

(2)

I am going to present to you:

• The meaning and purpose of Web service orchestrations

• Runtime errors that we would like to be able to avoid

• A simple orchestration language

• A new approach to behavioural typing: session-based programming

How the approach helps us avoid the runtime errors

at compile-time

(3)

To do so, I am going to:

• Introduce Web services, orchestration, and interaction errors

• Present a simple orchestration language with a

promising new feature: typed sessions (a concurrent programming paradigm with lots of potential)

• Jump into an example of an orchestration

– Implement the orchestration

– Show that the implementation contains errors – Show how the errors are detected

– Correct the code

(4)

Service Oriented Architecture (SOA)

(w3c.org)

• Message-based communication

• Loosely coupled

services

(5)

Web service orchestration

Orchestrator

Web service Web service

Web service client

Web service

instance Web service

instance

Web service

instance

(6)

Interactions errors

or

A service client is awaiting message

… but the message queue contains

(7)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e) s ? c(arg_c)

Traditional computation

tasks can be done externally.

(8)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

•Session types: Behavioural types that specify allowed interactions.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e)

T_Service service type:

s ? c(arg_c)

(9)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e)

T_Service service type:

s ? c(arg_c)

•Session types: Behavioural types that specify allowed interactions.

(10)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e)

T_Service service type:

s ? c(arg_c)

•Session types: Behavioural types that specify allowed interactions.

(11)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e)

T_Service service type:

s ? c(arg_c)

•Session types: Behavioural types that specify allowed interactions.

(12)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e)

T_Service service type:

s ? c(arg_c)

•Session types: Behavioural types that specify allowed interactions.

(13)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e)

T_Service service type:

s ? c(arg_c)

•Session types: Behavioural types that specify allowed interactions.

(14)

A simple orchestration language with typed sessions

•Atomic activities: Invocation, Reception, Session initiation

•Structured activities: Sequence, Parallel, Pick, Recursion…

•Control links: Synchronisation of parallel activities.

p = addr : T_Service s @ p

s ! a(arg_a) s ? b(arg_b)

s ! d(arg_d) s ! e(arg_e)

T_Service service type:

s ? c(arg_c)

•Session types: Behavioural types that specify allowed interactions.

(15)

Example service orchestration:

The Event Booking System

The Event Booking System chooses a date from a previously set up

Doodle page and books a room by using EOLE and some equipment

by using the DSI service.

(16)

Example service orchestration:

The Event Booking System

The Event Booking System chooses a date from a previously set up Doodle page and books a room by using EOLE and some equipment by using the DSI service.

Doodle Session

Type

EOLE Session

Type

DSI Session EBS

Session

Type

(17)

Required Session types

(18)

Provided Session type Required Session types

(19)

String date;

String room;

String event;

String equip;

s ? bookEvent(event,equip) Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

Provided Session type Required Session types

(20)

d @ doodle e @ eole i @ dsi String date;

String room;

String event;

String equip;

PARALLEL

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

s ? bookEvent(event,equip)

Provided Session type Required Session types

(21)

d @ doodle e @ eole i @ dsi String date;

String room;

String event;

String equip;

PARALLEL

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

s ? bookEvent(event,equip)

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

Provided Session type Required Session types

(22)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

s ? bookEvent(event,equip) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

e ? noRoom()

Provided Session type Required Session types

(23)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room) s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

e ? noRoom()

i ? refuse()

Provided Session type Required Session types

(24)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

e ? noRoom()

i ? refuse()

Provided Session type Required Session types

(25)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

Provided Session type Required Session types

(26)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

What happens if we push the button ?

Provided Session type Required Session types

(27)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

4 errors detected

Provided Session type Required Session types

(28)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

3 variable errors

(29)

PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

1 error left

3 variable errors

= valid state

= error state Part of the Event

Booking System’s control graph.

s ? bookEvent(event,equip) d @ doodle

e @ eole i @ dsi

(30)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

1 error left

(31)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

1 type errors

Provided Session type Required Session types

(32)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room) String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

1 type errors

Provided Session type

(33)

s ! eventFailed() s ! eventBooked(date,room)

s ? bookEvent(event,equip)

or

Network Web service client

b @ EBS

b ! bookEvent(« dbweb seminar », « laptop ») b ? eventBooked(room,date)

(34)

s ! eventFailed() s ! eventBooked(date,room)

s ? bookEvent(event,equip)

or

Network Web service client

b @ EBS

b ! bookEvent(« dbweb seminar », « laptop ») b ? eventBooked(room,date)

b @ EBS

(35)

s ! eventFailed() s ! eventBooked(date,room)

s ? bookEvent(event,equip)

or

Network Web service client

b @ EBS

b ! bookEvent(« dbweb seminar », « laptop ») b ? eventBooked(room,date)

b @ EBS

b @ EBS

(36)

s ! eventFailed() s ! eventBooked(date,room)

s ? bookEvent(event,equip)

or

Network Web service client

b @ EBS

b ! bookEvent(« dbweb seminar », « laptop ») b ? eventBooked(room,date)

b @ EBS

b @ EBS

b ! bookEvent(…)

(37)

s ! eventFailed() s ! eventBooked(date,room)

s ? bookEvent(event,equip)

or

Network Web service client

b @ EBS

b ! bookEvent(« dbweb seminar », « laptop ») b ? eventBooked(room,date)

b @ EBS

b @ EBS

b ! bookEvent(…)

b ! bookEvent(…)

(38)

s ! eventFailed() s ! eventBooked(date,room)

s ? bookEvent(event,equip)

or

Network Web service client

b @ EBS

b ! bookEvent(« dbweb seminar », « laptop ») b ? eventBooked(room,date)

b @ EBS

b @ EBS

b ! bookEvent(…)

b ! bookEvent(…)

! eventFailed()

(39)

s ! eventFailed() s ! eventBooked(date,room)

s ? bookEvent(event,equip)

or

Network Web service client

b @ EBS

b ! bookEvent(« dbweb seminar », « laptop ») b ? eventBooked(room,date)

b @ EBS

b @ EBS

b ! bookEvent(…)

b ! bookEvent(…)

! eventFailed()

! eventFailed()

(40)

Solution:

(41)

d @ doodle e @ eole i @ dsi PARALLEL

d ! findDate(event) d ? date(date)

d ! validateAndNotify(date)

e ! setDate(date)

e ! setRoomType(« meeting ») e ? getRoom(room)

e ! bookRoom()

i ! setRequest(equip,date) i ! setRoom(room)

s ! eventBooked(date,room) s ! eventFailed()

s ? bookEvent(event,equip)

i ? accept(room)

Error free

String date;

String room;

String event;

String equip;

Doodle_t doodle = @1;

EOLE eole = @2;

DSI dsi = @3;

EBS_T s;

or e ? noRoom()

i ? refuse()

Provided Session type Required Session types

(42)

Related work

• The language I presented is based on BPEL

– Much work has gone into giving BPEL formal semantics, not an easy task

• The session paradigm is a vast topic that has warranted much attention recently

– See “Language primitives and type discipline for structured communication-based programming” – Kohei Honda, Vasco T. Vasconcelos, Makoto Kubo.

– Interesting extensions such as multiparty sessions

(43)

Main contributions

• A formal definition of an orchestration language

– Based on BPEL

– Novel semantics that capture important parts of BPEL compared to related work

• Behavioural typing extension

– Session types are supported

• Main result: Theorem of interaction safety – any well-typed configuration of services is

interaction safe.

(44)

Conclusion

• Web service orchestrations are value added compositions of existing services

• Orchestrations are prone to certain types of runtime errors

• Session-based programming is a new paradigm that can help to detect these errors before deployment

We can prove that if services correctly implement their session types, then the property of safe

interaction is verified.

(45)

Thank you for listening

Remember : Just sessionize it !

Références

Documents relatifs

Working in groups (made of five students), students had 1 h to familiarise themselves with the tool’s contents, 4 h to generate ideas and place them on the Innovation Diagram, and 3

However, non-functional — also called Quality of Service (QoS) — aspects involved in services and their compositions need also to be considered.. The QoS of a service is

The application bundles approaches for both event log sanitization, which transforms an event log into one that meets privacy criteria, as well as privatized process mining

Probabilistic contract composition: This is the process of deriving a con- tract which can be offered to the orchestration’s client, from contracts established with the services

In this paper we clarify the service systems worldview proposed by Service Science researchers Spohrer and Kwan by investigating its foundational concepts from

The overall basic steps in the workflow are: find the evaluation description of a specific campaign scenario; extract the information about the tools and datasets from

Gleichzeitig wollen Unternehmen und Forschungsorganisationen diesen Bedarf möglichst kosteneffizient befriedigen - in Zeiten des Cloud-Computings am besten als einen

Although existing approaches, such as Dynvoker [6], already cover the generation of user inter- faces for single web services dynamically, no solution is available for