USP presentation of CHOReOS @ FISL Conference

Post on 01-Dec-2014

925 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

Transcript

Web Service Orchestration

Emílio Francesquini, Felipe Besson, Leonardo LeiteIME - USP

{emilio, besson, leofl}@ime.usp.br

FISL 12Porto Alegre, June 29, 2011

2

Service - Definition

• According to W3C, web service:o Is a software system designed to support machine-to-

machine interaction over a networko Is described by an interface which is machine readable

(more specific WSDL)• Other systems can interact with web services through

Soap messages• The interaction is realized using XML over HTTP, and

other web standards

Examples in the WebRSS

Google Calendar (CalDAV over HTTP) can be synchronized with iCal

Amazon Web Services (SOAP ou REST over HTTP)o EC2o S3o SimpleDBo ...

3

Web Services

• Web services have been used to integrate systems, replacing:

o The use of TCP/IP socketso CORBA, JRMI, RPC...

4

WS – Features

• Any language supporting TCP sockets are ready for using web services

• The use of HTTP make web services more suitable for bypassing firewalls, proxies, …

• It is widely accepted by companies• Loose coupling and the possibility of evolution of the

interface while maintaining backward compatibility

5

SOAP

• Standard for supporting the interoperability of heterogeneous systems.

• Since 2003, it is a W3C standard• In the beginning, Soap was an acronym for Simple Object

Access Protocolo Then, it was decided that the acronym means

nothing :-)

6

Message Format

7

Example of a Soap request

8

Example of a Soap response

9

WSDL - Hello world<?xml version="1.0" encoding="UTF-8"?><definitions xmlns:soap=””http://schemas.xmlsoap.org/wsdl/soap/"xmlns:tns=”http://hello” xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://hello/"name="HelloWorldService">

<types><xsd:schema><xsd:import namespace="http://hello/" schemaLocatio=”http://localhost:8080/hello?xsd=1"></xsd:import></xsd:schema></types>

<message name="sayHelloTo"><part name="parameter" element="tns:sayHelloTo"></part></message><message name="sayHelloToResponse"><part name="parameter" element="tns:sayHelloToResponse"></part></message>

<portType name="HelloWorld"><operation name="sayHelloTo"><input message="tns:sayHelloTo"></input><output message="tns:sayHelloToResponse"></output></operation></portType> 10

WSDL Example - Hello world

<binding name="HelloWorldPortBinding" type="tns:HelloWorld"><soap:binding transport="http://schemas.xmlsoap.org/soap/http”style="document"></soap:binding><operation name="sayHelloTo"><input><soap:body use="literal"></soap:body></input><output><soap:body use="literal"></soap:body></output></operation></binding>

<service name="HelloWorldService"><port name="HelloWorldPort" binding="tns:HelloWorldPortBinding"><soap:address location="http://localhost:8080/hello”></soap:address></port></service></definitions> 11

Disadvantages

• Messages are too big:o Low performance during the processing in the client and

the server sideso Requested Bandwidth is largeo Extremely inefficient when compared to CORBA or JRMI

technologies

12

WS Composition

• Tipically, a real case of WS Composition involves:o More than one web serviceo Order / interdependence between requests to web

serviceso Decision making during the workflow based on the

information obtained so faro Dealing with services unavailabilityo Transaction controlo Business automationo ...

13

Web Service Compositions

• Orchestration - Centralized

• Choreography - Distributed

14

Composition - Example

• Sale system:o Customer registrationo Charging

• Used in all computers of a store

15

Solution 1

• I can write the code using my favorite programming language and then, I integrate the ws client into my system:o web services accesso exception handling

• The workflow is defined by myself

16

Solution 2

• I can copy the code and deploy it with my website• Now, both website and client share the code containing

the workflow, rules, ….

17

Problems 1

• Web services are implemented possibly in several languages but the information flow and their relationship get couple to a specific language

• The developer must deal with:o Paralelismo Transactiono Fault tolerance (e.g., service unavailability)

18

Problems 2

• Changes in web services, even small ones, involves customers' upgrade and deployment of new version of the site

• Client/Site can became overloaded due the communication with the server

• Limitation of devices / code replication..

19

Solution 3

• A new web service is createdo Containing the entire workflow and composition ruleso Controlling transactions, paralellism and exceptions

handling

• Clients, sites and devices begin to use this web service directly

20

However, some problems remain

• Workflow coupled to a specific programming language• The developer still must deal with the transaction,

parallelism and exceptions handling.

21

Orchestration

• BPEL – Business Process Execution Languageo 2002

o BPEL4WS – BEA (now Oracle)o WSFL – IBM o XLANG – Microsofto ... SAP and Siebel Systems.

o 2003 – Open Standard WS-BPEL, by OASISo XML with .bpel extensiono Normally called by BPEL when the specific version

does not matter

22

BPEL

Shin, 2010

23

Motivations for using BPEL• A business standard

• Supported by tools, some of them free, for editing and executing BPELo Apache – ODEo Oracle – OpenESB, NetBeans 6.Xo Active Endpoints – The Active BPEL, ActiveBPEL

Designer o Microsoft – BizTalk o Oracle – BPEL Process Managero Petalslink – EasyBPEL

• Portability* between different enforcement mechanisms24

BPEL Structure

25

<process ...>

... (activities belonging to the business flow)

</process>

<partnerLinks> ... </partnerLinks>

<variables> ... </variables>

<correlationSets> ... </correlationSets>

<compensationHandlers> ... </compensationHandlers>

<eventHandlers> ... </eventHandlers>

Activities accepted by BPEL

• Basic• <invoke>• <receive>• <reply>• <assign>• <throw>• <wait>• <empty>• <exit>

26

• Structured• <if>• <while>• <repeatUntil>• <foreach>• <pick>• <flow>• <sequence>• <scope>

BPEL - synchronous example

<?xml version="1.0" encoding="UTF-8"?><process name="SynchronousSample" ...>

<import namespace="http://SynchronousSample"location="SynchronousSample.xsd"importType="http://www.w3.org/2001/XMLSchema"/>

<import namespace="http://SynchronousSample"location="SynchronousSample.wsdl"importType="http://schemas.xmlsoap.org/wsdl/"/>

27

BPEL - synchronous example<partnerLinks><partnerLinkname="SynchronousSample"partnerLinkType="ns1:partnerlinktype1"myRole="partnerlinktyperole1"></partnerLink></partnerLinks>

<variables><variable name="outputVar"messageType="ns1:responseMessage"/><variable name="inputVar" messageType="ns1:requestMessage"/></variables>

28

BPEL - Exemplo síncrono

<sequence>

<receive name="start" partnerLink="SynchronousSample" operation="operation1"portType="ns1:portType1" variable="inputVar" createInstance="yes"/>

<assign name="Assign1"> <copy><from>concat('Hello ', $inputVar.inputType/ns2:paramA, '!!!')</from><to>$outputVar.resultType/ns2:paramA</to></copy></assign>

<reply name="end" partnerLink="SynchronousSample" operation="operation1"portType="ns1:portType1" variable="outputVar"></reply></sequence></process>

29

BPEL - synchronous example

30

BPEL - synchronous example

31

ESB

• Acronym for Enterprise Service Bus

• The same idea of hardware bus, ESB is charge of:o transporting, o routing,o And messages delivering

• Service access management • These activities can be performed without an ESB

o The goal of a ESB is just facilitate the work =p

32

Petals

33

• Open Source ESB – LGPL 2.1

• Compatible with the standards: JBI and BPEL

• Hot service deployment

• Hot component installation

• Tools to support the development:o PetalsStudioo Web Console

34

Questions?

This research has received founding from:

References

• W3C Web Services Choreography Working Group Charter• http://www.w3.org/2005/12/wscwg-charter.html• Web Services Glossary, http://www.w3.org/TR/ws-gloss/

35

References

• ZHANG, Liang-Jie. Services Computing, Pequim, Springer, 2007

• Hewitt, Eben, Java SOA Cookbook, 1st Edition, 2009, • Shin, San, SOA Using OpenESB, BPEL and NetBeans,

2010• http://ccsl.ime.usp.br/baile

36

top related