• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Composing REST Services
 

Composing REST Services

on

  • 1,946 views

 

Statistics

Views

Total Views
1,946
Views on SlideShare
1,941
Embed Views
5

Actions

Likes
1
Downloads
64
Comments
0

2 Embeds 5

http://www.slideshare.net 4
http://localhost 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Composing REST Services Composing REST Services Presentation Transcript

    • Composing REST Services Open Dagstuhl Session Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 1
    • Web Service Composition Today The WS-BPEL process WS-BPEL 2.0 model is layered on top of the service model defined WSDL 1.1 by WSDL 1.1. […] Both the process and its partners are exposed as WSDL services [BPEL 2.0 Standard, Section 3] 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 2
    • RESTful Web Services APIs… WSDL 1.1 …do not use WSDL 1.1 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 3
    • The Goal Compose RESTful Web Services Compose WSDL Web Services Use Business Process Modeling Languages One Solution: BPEL for REST Extend BPEL to support RESTful Web Services 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 4
    • The Goal Compose RESTful Web Services Compose WSDL Web Services Use Business Process Modeling Languages Another Solution: JOpera Visual Flow Language with Abstract Service Model Extensible Autonomic Engine Architecture 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 5
    • REST in one slide PUT Web Services expose their data and functionality trough GET R resources identified by URI POST DELETE 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 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 6
    • Challenges for Composition Languages Resource addressing through URI How 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 representations How to negotiate the most appropriate representation? Hyperlinks Can the workflow implement state transition logic of a resource and generate new URIs dynamically as processes run to guide the clients invoking them? 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 7
    • JOpera Example: Doodle Map Mashup Setup a Doodle with Yahoo! Local search and visualize the results of the poll on Google Maps 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 8
    • Doodle Map Mashup Architecture Web Browser Workflow RESTful Engine Web Services RESTful API APIs GET POST GET 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 9
    • 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 10
    • BPM RESTful Workflow Web Service Languages Composition 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 11
    • Solution Space BPM Workflow RESTful Web Service Languages Composition 1. Abstract Workflow Service invocation technology does not matter 2. Concrete Workflow BPM Expose service invocation RESTful Workflow Web Service LanguagesComposition technologies as explicit constructs in the workflow language 3. RESTful Workflow BPM Workflow as one kind of resource RESTful Workflow Web Service Languages Composition exposed by a RESTful service 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 12
    • 1. Abstract Workflow Example: BPEL/WSDL WSDL 2.0 HTTP Binding can wrap RESTful Web Services (WS-BPEL 2.0 does not support WSDL 2.0) BPEL WSDL 2.0 PUT Operations ... Op_1 <Invoke Op_1> Op_2 Op_3 GET R <Invoke Op_2> Op_4 ... HTTP Binding POST DELETE <Invoke Op_3> Op URI Method Op_1 R PUT PUT <Invoke Op_4> Op_2 R GET GET Op_3 R POST POST ... Op_4 R DELETE DELETE 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 13
    • 2. Concrete Workflow: BPEL for REST Idea: Make REST interaction primitives first-class language constructs BPEL for REST PUT ... <Put R> GET R <Get R> ... POST DELETE R> <Post R> <Delete R> <Delete R> ... 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 14
    • BPEL for REST – New Activities/Handlers PUT <put> <onPut> <get> GET R esource <onGet> <post> <onPost> POST <delete> DELETE <onDelete> Web <receive> <invoke> Service <reply> <invoke> Web <receive> Service 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 15
    • BPEL for REST – Resource Block Dynamically publish resources from BPEL processes and handle client requests BPEL for REST PUT <Resource P> PUT <onGet> <Put R> GET R <Get S> POST GET P </onGet> DELETE <onDelete> PUT POST DELETE <Post R> <Delete S> GET S </onDelete> </Resource> POST DELETE 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 16
    • 3. RESTful Workflows PUT P GET R POST DELETE Use the resource interface abstraction to publish the state of the workflow 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 17
    • Workflows as Resources – URI 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 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 18
    • Reading the state of the workflow resources GET /package/process Enumerate deployed process versions GET /package/process/version Enumerate active instances of a given process version GET /package/process/version/instance Read the current state of a workflow instance GET /package/process/version/instance/task Read the current state of a workflow instance task GET /package/process/version/instance/task/param Read the current value of a workflow instance parameter 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 19
    • Creating new workflow resources POST /package Deploy new process template into package POST /package/process Deploy new version of a process POST /package/process/version Create new process instance 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 20
    • Updating the workflow resource PUT /package/process/version/instance/task Update the state of a workflow task (e.g., finished, failed) PUT /package/process/version/instance/task/param Write into task parameters some values 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 21
    • Deleting workflow resources DELETE /package/process Undeploy all versions of a process (and all the corresponding process instances) DELETE /package/process/version Undeploy a version of a process (and all of its instances) DELETE /package/process/version/instance Remove the state of a specific process instance only 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 22
    • Discussion 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? 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 23
    • Conclusion 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 BPEL for REST is a lightweight BPEL extension for REST and WS-* service composition JOpera for Eclipse is a visual process modeling tool with an extensible engine for composing both kinds of services (and many more) 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 24
    • Some References 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. Pautasso, BPEL for REST, Proc. of the 7th International Conference on Business Process Management (BPM 2008), Milano, Italy, September 2008 Xiwei (Sherry) Xu, Liming Zhu, Yan Liu, Mark Staples, Resource- Oriented Architecture for Business Processes, APSEC’08 6 January 2009 ©2009 Cesare Pautasso | www.pautasso.info 25
    • PhD positions available! Prof. Cesare Pautasso University of Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info 26 ©2008 Cesare Pautasso