usp presentation of choreos @ fisl conference
DESCRIPTION
TRANSCRIPT
![Page 1: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/1.jpg)
Web Service Orchestration
Emílio Francesquini, Felipe Besson, Leonardo LeiteIME - USP
{emilio, besson, leofl}@ime.usp.br
FISL 12Porto Alegre, June 29, 2011
![Page 2: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/2.jpg)
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
![Page 3: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/3.jpg)
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
![Page 4: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/4.jpg)
Web Services
• Web services have been used to integrate systems, replacing:
o The use of TCP/IP socketso CORBA, JRMI, RPC...
4
![Page 5: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/5.jpg)
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
![Page 6: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/6.jpg)
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
![Page 7: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/7.jpg)
Message Format
7
![Page 8: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/8.jpg)
Example of a Soap request
8
![Page 9: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/9.jpg)
Example of a Soap response
9
![Page 10: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/10.jpg)
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
![Page 11: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/11.jpg)
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
![Page 12: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/12.jpg)
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
![Page 13: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/13.jpg)
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
![Page 14: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/14.jpg)
Web Service Compositions
• Orchestration - Centralized
• Choreography - Distributed
14
![Page 15: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/15.jpg)
Composition - Example
• Sale system:o Customer registrationo Charging
• Used in all computers of a store
15
![Page 16: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/16.jpg)
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
![Page 17: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/17.jpg)
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
![Page 18: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/18.jpg)
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
![Page 19: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/19.jpg)
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
![Page 20: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/20.jpg)
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
![Page 21: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/21.jpg)
However, some problems remain
• Workflow coupled to a specific programming language• The developer still must deal with the transaction,
parallelism and exceptions handling.
21
![Page 22: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/22.jpg)
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
![Page 23: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/23.jpg)
BPEL
Shin, 2010
23
![Page 24: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/24.jpg)
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
![Page 25: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/25.jpg)
BPEL Structure
25
<process ...>
... (activities belonging to the business flow)
</process>
<partnerLinks> ... </partnerLinks>
<variables> ... </variables>
<correlationSets> ... </correlationSets>
<compensationHandlers> ... </compensationHandlers>
<eventHandlers> ... </eventHandlers>
![Page 26: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/26.jpg)
Activities accepted by BPEL
• Basic• <invoke>• <receive>• <reply>• <assign>• <throw>• <wait>• <empty>• <exit>
26
• Structured• <if>• <while>• <repeatUntil>• <foreach>• <pick>• <flow>• <sequence>• <scope>
![Page 27: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/27.jpg)
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
![Page 28: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/28.jpg)
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
![Page 29: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/29.jpg)
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
![Page 30: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/30.jpg)
BPEL - synchronous example
30
![Page 31: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/31.jpg)
BPEL - synchronous example
31
![Page 32: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/32.jpg)
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
![Page 33: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/33.jpg)
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
![Page 34: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/34.jpg)
34
Questions?
This research has received founding from:
![Page 35: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/35.jpg)
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
![Page 36: USP presentation of CHOReOS @ FISL Conference](https://reader033.vdocuments.us/reader033/viewer/2022051323/547c50ffb47959a2508b4634/html5/thumbnails/36.jpg)
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