Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
128 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
RESTful Web Service Compositionwith JOpera
Cesare PautassoFaculty of Informatics
University of Lugano (USI), Switzerlandhttp://www.pautasso.info
©2008 Cesare Pautasso2
• Faculty of Informatics (Opened 2004)• 15 Professors• 63 PhDs & Post-docs
• Excellence in Research• Innovative Teaching
University of Lugano, Switzerland
©2008 Cesare Pautasso3
My Research Interests
Web 2.0Mashups
BusinessProcess
Management
AutonomicComputing
ScientificWorkflow
Management
ServiceOriented
Architectures
SoftwareComposition
CesarePautasso
428 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
RESTful Web Service Compositionwith JOpera
Cesare PautassoFaculty of Informatics
University of Lugano (USI), Switzerlandhttp://www.pautasso.info
528 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
The WS-BPEL process model is layered on top of the service model defined by WSDL 1.1. […] Both the process and its partners are exposed as WSDL services
[BPEL 2.0 Standard, Section 3]
Web Service Composition Today
WSDL 1.1
WS-BPEL 2.0
628 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
RESTful Web Services APIs…
WSDL 1.1
…do not use WSDL 1.1
728 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Compose RESTful Web Services
Compose WSDL Web Services
Use Business Process Modeling Languages
The Goal
Visual Flow Language with Abstract Service Model
Extensible Autonomic Engine Architecture
JOpera
828 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Motivation
REST Introduction
Composing RESTful servicesAbstract Workflows
Concrete Workflows
RESTful Workflows
JOpera Example: Doodle Map Mashup
Discussion, Conclusion, Outlook
Agenda
928 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Web Sites (1992)
HTTP
HTMLWeb Browser
Web Server
(HTTP)
SOAP
ServerClient XMLWSDL
WS-* Web Services (2000)
1028 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
RESTful Web Services (2007)
Client HTTP
PO-XM
L
RSS
JSON
Web Server
WADL
(HTTP)
SOAP
ServerClient XMLWSDL
WS-* Web Services (2000)
1128 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
File Transfer
Shared Data
Remote Procedure CallMessage Bus
Events
Stream
REpresentationalState Transfer
Application Integration Styles vs. REST
1228 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Web Services expose their data and functionality trough resources identified by URI
Uniform Interface Principle: Clients interact with the state of resources through 4 verbs: GET (read), POST (create), PUT (update), DELETE
Multiple representations for the same resource
Hyperlinks model resource relationships and valid state transitions
REST in one slide
R
PUT
DELETE
GET
POST
1328 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Resource addressing through URIHow to interact with dynamic, variable set of URI?
Uniform Interface (GET, POST, PUT, DELETE)Does it help to make the verbs explicit in the workflow?
Multiple resource representationsHow to negotiate the most appropriate representation?
HyperlinksCan the workflow implement state transition logic of a resource and generate new URIs dynamically as processes run to guide the clients invoking them?
Challenges for Composition Languages
1428 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
BPMWorkflow
Languages
RESTfulWeb ServiceComposition
1528 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
1. Abstract WorkflowService invocation technology does not matter
2. Concrete WorkflowExpose service invocation technologies as explicit constructsin the workflow language
3. RESTful WorkflowWorkflow as one kind of resource exposed by a RESTful service
Solution Space BPMWorkflow
Languages
RESTfulWeb ServiceComposition
BPMWorkflow
Languages
RESTfulWeb ServiceComposition
BPMWorkflow
Languages
RESTfulWeb ServiceComposition
1628 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
WSDL 2.0 HTTP Binding can wrap RESTful Web Services
1. Abstract Workflow Example: BPEL/WSDL
R
WSDL 2.0BPEL PUT
DELETE
GET
POST
Operations
HTTP Binding
Op_1Op_2Op_3Op_4
...
<Invoke Op_1>
<Invoke Op_2>
...
<Invoke Op_3>
<Invoke Op_4>
...
Op_1 R PUTOp_2 R GETOp_3 R POSTOp_4 R DELETE
Op URI Method
R PUTR GETR POSTR DELETE
(WS-BPEL 2.0 does not support WSDL 2.0)
1728 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Idea: Make REST interaction primitives first-class language constructs
2. Concrete Workflow: BPEL for REST
R
BPEL for REST PUT
DELETE
GET
POST
...
<Put R>
<Get R>
...
<Post R>
<Delete R>
...
<Put R>
<Get R>
<Post R>
<Delete R>
1828 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
BPEL for REST – New Activities/Handlers
WebService<invoke>
WebService
<invoke>
<receive><reply>
<receive>
R esource
PUT
DELETE
GET
POST
<put><get><post><delete>
<onPut><onGet><onPost>
<onDelete>
1928 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Dynamically publish resources from BPEL processes and handle client requests
BPEL for REST<Resource P>
<onGet>
<Put R>
<Get S>
</onGet>
<Post R>
<Delete S>
</onDelete>
</Resource>
<onDelete>
R
PUT
DELETE
GET
POST
S
PUT
DELETE
GET
POST
P
PUT
DELETE
GET
POST
BPEL for REST – Resource Block
2028 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
3. RESTful WorkflowsP
R
PUT
DELETE
GET
POST
R
PUT
DELETE
GET
POST
Use the resource interface abstraction to publish the state of the workflow
2128 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Publish workflows as resources identified by the URIs:
/package/process
/package/process/version
/package/process/version/instance
/package/process/version/instance/task
/package/process/version/instance/task/parameter
Workflows as Resources – URI
2228 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
GET /package/processEnumerate deployed process versions
GET /package/process/versionEnumerate active instances of a given process version
GET /package/process/version/instanceRead the current state of a workflow instance
GET /package/process/version/instance/taskRead the current state of a workflow instance task
GET /package/process/version/instance/task/paramRead the current value of a workflow instance parameter
Reading the state of the workflow resources
2328 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
POST /packageDeploy new process template into package
POST /package/processDeploy new version of a process
POST /package/process/versionCreate new process instance
Creating new workflow resources
2428 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
PUT /package/process/version/instance/taskUpdate the state of a workflow task (e.g., finished, failed)
PUT /package/process/version/instance/task/paramWrite into task parameters some values
Updating the workflow resource
2528 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
DELETE /package/processUndeploy all versions of a process (and all the corresponding process instances)
DELETE /package/process/versionUndeploy a version of a process (and all of its instances)
DELETE /package/process/version/instanceRemove the state of a specific process instance only
Deleting workflow resources
2628 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Motivation
REST Introduction
Composing RESTful servicesAbstract Workflows
Concrete Workflows
RESTful Workflows
JOpera Example: Doodle Map Mashup
Discussion, Conclusion, Outlook
Agenda
2728 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
JOpera Example: Doodle Map MashupSetup a Doodle with Yahoo! Local search and visualize the results of the poll on Google Maps
2828 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Doodle Map Mashup Architecture
Web Browser WorkflowEngine
RESTfulWeb Services
APIsGET
POST
GET
RES
Tful
API
2928 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
3028 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Why should a workflow engine care about REST? Use workflows to compose RESTful Web services
Implement RESTful services with a workflow
Should a process explicitly include RESTful activities?Or it is better/enough to model REST implicitly?
How much of the state of a process instance should be exposed as a resource?
How to control which “parts” are visible?
Discussion
3128 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Business Process Modeling Languages have been applied with success to compose “traditional” WS-* Web Services (BPM = SOA + BPEL)
Business Process Modeling Languages should also be applied to compose RESTful Web Services
JOpera for Eclipse is a visual process modeling tool with an extensible engine for composing both kinds of services (and many more)
Conclusion
3228 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
R. Fielding, Architectural Styles and the Design of Network-based Software Architectures, PhD Thesis, University of California, Irvine, 2000
C. Pautasso, O. Zimmermann, F. Leymann, RESTful Web Services vs. Big Web Services: Making the Right Architectural Decision, Proc. of the 17th International World Wide Web Conference (WWW2008), Bejing, China, April 2008
C. Pautaso, BPEL for REST, Proc. of the 7th International Conference on Business Process Management (BPM 2008), Milano, Italy, September 2008
References
©2008 Cesare Pautasso33
PhD positions available!
Prof. Cesare PautassoUniversity of Lugano, Switzerland
[email protected]://www.pautasso.info
3428 November 2008 ©2008 Cesare Pautasso | www.pautasso.info
Second International Workshop on Web APIs and Services Mashups
(Mashups'08)http://icsoc-mashups.org/
Monday, December 1, 2008ICSOC 2008, Sydney, Australia