Composing RESTful
Services with JOpera
              Cesare Pautasso
         Software Composition 2009
              Zuri...
Composing RESTful Services
                     with JOpera

                           Cesare Pautasso
                  ...
Web Service Composition Today

                    Composition Language                              WS-BPEL 2.0
         ...
RESTful Web Services APIs…


                                                          WSDL 1.1



                       ...
Our Goal
  Compose RESTful Web Services into
        Mashups




 2 July 2009      ©2009 Cesare Pautasso | www.pautasso.i...
Web 2.0 Mashups
 Software Composition for the Web


                 A mashup is a web application that
               co...
Example Mashup with RESTful Web Services

               +                             +                 =


 2 July 2009 ...
Our Goal
  Compose RESTful Web Services into
        Mashups

Our Current Solution: JOpera
 Workflow-based, Visual Compo...
Agenda
 Motivation
 REST Introduction (one slide)
 Composing RESTful services
 Demo: Doodle Map Mashup with JOpera
 C...
REST in one slide                                                   PUT

 Web Services expose their
     data and functio...
REST design elements
  Resources are published by Origin Servers
  Proxy/Gateways for caching, access control, adaptatio...
What about composition?
  The basic design elements of the REST architectural style do
       not take composition into a...
Composite Resources
                     DELETE
               PUT


               GET
                      C
          ...
Doodle Map Mashup
  Setup a Doodle with Yahoo! Local search and
       visualize the results of the poll on Google Maps

...
Doodle Map Composite Resources
                 Client                Composite                     Component
            ...
Doodle Map Architecture
 Web Browser                          JOpera                                             RESTful
 ...
Demo
2 July 2009   ©2009 Cesare Pautasso | www.pautasso.info   17
Modeling the Composition in JOpera


                Control                             Data
                 Flow       ...
Control
 Flow




     Control Flow
     Dependency




2 July 2009         ©2009 Cesare Pautasso | www.pautasso.info   19
Data
  Flow




              Data Flow
              (Copy)




2 July 2009               ©2009 Cesare Pautasso | www.pau...
Service
Bindings

     HTTP

    HTML

     XSLT

   XPATH

     JAVA

         …
 2 July 2009   ©2009 Cesare Pautasso | w...
Composition and REST: Some Challenges
 Resource addressing through URI
              How to interact with dynamic, varia...
Resource Addressing through URI
 How to interact with dynamic, variable set of URI?




  2 July 2009             ©2009 C...
Uniform Interface (GET, POST, PUT, DELETE)
 Is this a new composition technique?




 Easy to configure the HTTP method ...
Multiple Resource Representations
 Resource data type may only be known at run-time
 How to negotiate the most appropria...
Hyperlinks
 Can the state of a composition be bookmarked?
           Follow hyperlinks




                              ...
Composition and REST: More Challenges
 Missing Interface Description
              How to compose services without machi...
Conclusion
 Business Process Modeling Languages have been
  applied with success to compose “traditional” WS-*
  Web Serv...
Composing RESTful Services
                     with JOpera
                           Cesare Pautasso
                   ...
PhD positions available!


                      Prof. Cesare Pautasso
                 University of Lugano, Switzerland
...
Mashups09 @ OOPSLA

                       http://www.mashup-oopsla.org/




               3rd International Workshop on
...
Upcoming SlideShare
Loading in …5
×

Composing RESTful Services with JOpera

1,869 views

Published on

Software Composition 2009

Published in: Technology, Business
1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total views
1,869
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
0
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide

Composing RESTful Services with JOpera

  1. 1. Composing RESTful Services with JOpera Cesare Pautasso Software Composition 2009 Zurich, Switzerland 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 1
  2. 2. Composing RESTful Services with JOpera Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info http://www.jopera.org 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 2
  3. 3. Web Service Composition Today Composition Language WS-BPEL 2.0 Component Model WSDL 1.1 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] 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 3
  4. 4. RESTful Web Services APIs… WSDL 1.1 …do not use WSDL 1.1 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 4
  5. 5. Our Goal  Compose RESTful Web Services into Mashups 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 5
  6. 6. Web 2.0 Mashups  Software Composition for the Web A mashup is a web application that combines data or functionality from two or more external sources to create a new service [Wikipedia] 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 6
  7. 7. Example Mashup with RESTful Web Services + + = 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 7
  8. 8. Our Goal  Compose RESTful Web Services into Mashups Our Current Solution: JOpera  Workflow-based, Visual Composition Language  Abstract and Extensible Component Model  Eclipse-based Integrated Composition Environment 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 8
  9. 9. Agenda  Motivation  REST Introduction (one slide)  Composing RESTful services  Demo: Doodle Map Mashup with JOpera  Challenges  Discussion 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 9
  10. 10. REST in one slide PUT  Web Services expose their data and functionality trough GET R resources identified by URI POST DELETE  Uniform Interface: 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, valid state transitions and interaction protocols 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 10
  11. 11. REST design elements  Resources are published by Origin Servers  Proxy/Gateways for caching, access control, adaptation HTTP User Agent Origin Server HTTP HTTP User Agent Proxy/Gateway Origin Server 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 11
  12. 12. What about composition?  The basic design elements of the REST architectural style do not take composition into account HTTP User Agent Origin Server Origin Server User Agent HTTP Composite ? HTTP Origin Server RESTful service Origin Server 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 12
  13. 13. Composite Resources DELETE PUT GET C DELETE DELETE POST PUT PUT GET R GET S POST POST 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 13
  14. 14. Doodle Map Mashup  Setup a Doodle with Yahoo! Local search and visualize the results of the poll on Google Maps 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 14
  15. 15. Doodle Map Composite Resources Client Composite Component Web Browser Resources Resources M GET Y GET PUT POST GET P GET D POST GET G 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 15
  16. 16. Doodle Map Architecture Web Browser JOpera RESTful Engine Web Services GET APIs POST GET POST GET RESTful API RESTful API 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 16
  17. 17. Demo 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 17
  18. 18. Modeling the Composition in JOpera Control Data Flow Flow Service Bindings JAVA XPATH XSLT HTML HTTP … 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 18
  19. 19. Control Flow Control Flow Dependency 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 19
  20. 20. Data Flow Data Flow (Copy) 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 20
  21. 21. Service Bindings HTTP HTML XSLT XPATH JAVA … 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 21
  22. 22. Composition and REST: Some Challenges  Resource addressing through URI  How to interact with dynamic, variable set of URI?  Uniform Interface (GET, POST, PUT, DELETE)  Is this a new composition technique?  Multiple resource representations  Resource data type may only be known at run-time  How to negotiate the most appropriate representation format?  Hyperlinks  Can the state of a composition be bookmarked? 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 22
  23. 23. Resource Addressing through URI  How to interact with dynamic, variable set of URI? 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 23
  24. 24. Uniform Interface (GET, POST, PUT, DELETE)  Is this a new composition technique?  Easy to configure the HTTP method in the adapter  Hard to handle failure/idempotency semantics 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 24
  25. 25. Multiple Resource Representations  Resource data type may only be known at run-time  How to negotiate the most appropriate representation format? Set HTTP Headers (Accept) 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 25
  26. 26. Hyperlinks  Can the state of a composition be bookmarked? Follow hyperlinks Generate hyperlinks 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 26
  27. 27. Composition and REST: More Challenges  Missing Interface Description  How to compose services without machine readable interface descriptions?  Request correlation  How to ensure stateless communication with the right instance of a composition?  Caching/Idempotency  Verification and Testing 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 27
  28. 28. Conclusion  Business Process Modeling Languages have been applied with success to compose “traditional” WS-* Web Services  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) into Web 2.0 mashups 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 28
  29. 29. Composing RESTful Services with JOpera Cesare Pautasso Faculty of Informatics University of Lugano (USI), Switzerland http://www.pautasso.info www.jopera.org 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 29
  30. 30. PhD positions available! Prof. Cesare Pautasso University of Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info 2.7.2009 30 ©2008 Cesare Pautasso
  31. 31. Mashups09 @ OOPSLA http://www.mashup-oopsla.org/ 3rd International Workshop on Web APIs and Services Mashups 2 July 2009 ©2009 Cesare Pautasso | www.pautasso.info 31

×