SlideShare uma empresa Scribd logo
1 de 56
RESTful Service Composition
with JOpera
Cesare Pautasso
Faculty of Informatics, USI Lugano, Switzerland
c.pautasso@ieee.org
http://www.pautasso.info
http://twitter.com/pautasso

21.5.2010
Abstract
             Next generation Web services technologies challenge the
             assumptions made by current standards for process-based
             service composition. For example, most existing RESTful
             Web service APIs cannot natively be composed using the
             WS-BPEL standard. In this talk we apply the notion of
             composition to RESTful services and discuss the
             conceptual relationship between business processes and
             stateful resources. Our goal is to enable lightweight access
             to service compositions published with a RESTful API.
             We show that the uniform interface and the hyper-linking
             capabilities of RESTful services provide an excellent
             abstraction for publishing proceses as a resource and
             exposing in a controlled way the execution state of a
             service composition.
             To do so, we present how to build a composite application
             (DoodleMap) out of some well-known, public and currently
             existing RESTful service APIs.


©2009-2010 - Cesare Pautasso, Erik Wilde                                    2
From REST-*



       “     We believe there is huge potential to
          marrying REST with workflow and BPM.




                                                        http://www.jboss.org/reststar/specifications/workflow.html
                              […]
          Combined with the architecture of the Web,
          a workflow service can provide both a truly
          simple, portable, and flexible way to build
          workflow driven integrations and


                          ”
          applications.




©2010 - Cesare Pautasso                                             3
WS-BPEL Primitives

                             Web       <receive>
            <invoke>
                             Service   <reply>


            <invoke>         Web
                                       <receive>
                             Service

      The workflow language natively supports the
       RPC or message-based connectors

©2010 - Cesare Pautasso                              4
WS-BPEL Primitives

                             Web       <receive>
            <invoke>
                             Service   <reply>


       Easy to map this to HTTP!
                              Web
            <invoke>                   <receive>
                             Service




©2010 - Cesare Pautasso                            5
BPEL and WSDL 2.0
           WSDL 2.0 HTTP Binding can wrap RESTful Web Services
          (WS-BPEL 2.0 does not support WSDL 2.0)




©2009-2010 - Cesare Pautasso, Erik Wilde                         6
RESTful APIs…

                          …do
                           not
                           use
                           WSDL



©2010 - Cesare Pautasso           7
WS-BPEL Primitives

                             Web       <receive>
            <invoke>
                             Service   <reply>


       Easy to map this to HTTP?
                              Web
            <invoke>                   <receive>
                             Service
       We need something else




©2010 - Cesare Pautasso                            8
From REST-*



       “   We believe there is huge potential to
       marrying REST with workflow and BPM.




                                                        http://www.jboss.org/reststar/specifications/workflow.html
      The HATEOAS (hypermedia and linking)
       principal of REST is logically a dynamic state
       machine and fits very well with how
       workflow and BPM systems are designed.
      Combined with the architecture of the Web,
       a workflow service can provide both a truly
       simple, portable, and flexible way to build
       workflow driven integrations and
       applications.

©2010 - Cesare Pautasso                                             9
Outline
   1. Introduction
      to RESTful Web Services
   2. Defining
      RESTful Service Composition
   3. JOpera Demo
   4. More than Mashups?


©2009-2010 - Cesare Pautasso, Erik Wilde   10
REST in one slide
  Web Services expose their
   data and functionality trough      PUT
   resources identified by URI
                                            R
  Uniform Interface Principle:        GET
   Clients interact with resources       POST
   through a fix set of verbs.                   DELETE
   Example HTTP:
   GET (read), POST (create), PUT (update), DELETE
  Multiple representations for the same resource
  Hyperlinks model resource relationships and valid
   state transitions for dynamic protocol description
   and discovery
©2010 - Cesare Pautasso                                   11
Design Methodology
   1. Identify resources to be exposed as
      services (e.g., yearly risk report, book




                                                                               DELETE
      catalog, purchase order, open bugs,




                                                                        POST
      polls and votes)




                                                            GET

                                                                  PUT
   2. Model relationships (e.g., containment,
      reference, state transitions) between      /loan                      
      resources with hyperlinks that can be
      followed to get more details (or perform   /balance                   
      state transitions)
                                                 /client                    
   3. Define “nice” URIs to address the
      resources                                  /book                      
   4. Understand what it means to do a GET,
      POST, PUT, DELETE for each resource        /order          ?           
      (and whether it is allowed or not)
   5. Design and document resource
      representations                            /soap                      
   6. Implement and deploy on Web server
   7. Test with a Web browser
©2009-2010 - Cesare Pautasso, Erik Wilde                                           12
Design Space
                                           M Representations (Variable)




©2009-2010 - Cesare Pautasso, Erik Wilde                                  13
Simple Doodle API Example
   1. Resources:




                                                                                     DELETE
      polls and votes




                                                                              POST
   2. Containment Relationship:




                                                                  GET
                                                                        PUT
          poll                             /poll                                   
             {id1}                         /poll/{id}                             
                      vote                 /poll/{id}/vote                         
                           {id4}           /poll/{id}/vote/{id}                    ?

                           {id5}           3.   URIs embed IDs of “child”
                                                instance resources
                                           4.   POST on the container is used to
                {id2}                           create child resources
                                           5.   PUT/DELETE for updating and
                {id3}                           removing child resources

©2009-2010 - Cesare Pautasso, Erik Wilde                                                      14
Simple Doodle API Example
  1.        Creating a poll
            (transfer the state of a new poll on the Doodle service)
                                            /poll
                                            /poll/090331x
                                            /poll/090331x/vote



   POST /poll                                             GET /poll/090331x
   <options>A,B,C</options>
                                                          200 OK
   201 Created                                            <options>A,B,C</options>
   Location: /poll/090331x                                <votes href=“/vote”/>


                                                                   2. Reading a poll
                              (transfer the state of the poll from the Doodle service)
©2009-2010 - Cesare Pautasso, Erik Wilde                                                 15
Simple Doodle API Example
   Participating in a poll by creating a new vote sub-resource
                                           /poll
                                           /poll/090331x
                                           /poll/090331x/vote
                                           /poll/090331x/vote/1



   POST /poll/090331x/vote                          GET /poll/090331x
   <name>C. Pautasso</name>
   <choice>B</choice>                               200 OK
                                                    <options>A,B,C</options>
   201 Created                                      <votes><vote id=“1”>
   Location:                                        <name>C. Pautasso</name>
   /poll/090331x/vote/1                             <choice>B</choice>
                                                    </vote></votes>


©2009-2010 - Cesare Pautasso, Erik Wilde                                       16
Simple Doodle API Example
   Existing votes can be updated (access control headers not shown)
                                           /poll
                                           /poll/090331x
                                           /poll/090331x/vote
                                           /poll/090331x/vote/1



   PUT /poll/090331x/vote/1                         GET /poll/090331x
   <name>C. Pautasso</name>
   <choice>C</choice>                               200 OK
                                                    <options>A,B,C</options>
   200 OK                                           <votes><vote id=“/1”>
                                                    <name>C. Pautasso</name>
                                                    <choice>C</choice>
                                                    </vote></votes>


©2009-2010 - Cesare Pautasso, Erik Wilde                                       17
Simple Doodle API Example
   Polls can be deleted once a decision has been made
                                           /poll
                                           /poll/090331x
                                           /poll/090331x/vote
                                           /poll/090331x/vote/1



   DELETE /poll/090331x                             GET /poll/090331x

   200 OK                                           404 Not Found




©2009-2010 - Cesare Pautasso, Erik Wilde                                18
Real Doodle Demo
  • Info on the real Doodle API:
  http://doodle.com/xsd1/RESTfulDoodle.pdf
  • Lightweight demo with Poster Firefox Extension:
  http://addons.mozilla.org/en-US/firefox/addon/2691




©2009-2010 - Cesare Pautasso, Erik Wilde               19
Different software connectors

                          RPC         ESB



                                WWW



©2010 - Cesare Pautasso                     20
REST Architectural Elements
      Client/Server                        Layered     Stateless Communication   Cache




                                               Proxy
                User Agent                                           Origin Server

                                                         Gateway


                                           Connector (HTTP)        Cache


©2009-2010 - Cesare Pautasso, Erik Wilde                                                 21
Basic Setup
                                                        HTTP

                                           User Agent          Origin Server

Adding Caching
                                HTTP                                        HTTP

        Caching                              Origin Server     User Agent            Caching
       User Agent                                                                  Origin Server
                                                        HTTP

                                            Caching              Caching
                                           User Agent          Origin Server

©2009-2010 - Cesare Pautasso, Erik Wilde                                                       22
Proxy or Gateway?
Intermediaries forward (and may translate) requests and responses


                                           HTTP         HTTP
           Client             Proxy                 Origin Server
A proxy is chosen by the Client (for caching, or access control)




                                            HTTP             HTTP
                    Client                         Gateway          Origin Server
          The use of a gateway (or reverse proxy) is imposed by the server



©2009-2010 - Cesare Pautasso, Erik Wilde                                            23
What about composition?
    The basic REST design     WS-BPEL is the standard
     elements do not take       Web service composition
                                language. Business process
     composition into account   models are used to specify
                                     how a collection of services
                HTTP                 is orchestrated into a
                                     composite service
     User Agent      Origin Server  Can we apply WS-BPEL to
                                     RESTful services?


                                  HTTP         Origin Server
        User Agent                         ?

                                               Origin Server
©2009-2010 - Cesare Pautasso, Erik Wilde                            24
REST Scalability


                                       Cache


                                    Proxy/Gateway   Origin
                                                    Server
                          Clients


      One example of REST middleware is to help
       with the scalability of a server, which may
       need to service a very large number of
       clients

©2010 - Cesare Pautasso                                      25
REST Composition




                                    Proxy/Gateway   Origin
                                                    Server
                          Clients


      Composition shifts the attention to the client
       which should consume and aggregate from
       many servers


©2010 - Cesare Pautasso                                      26
REST Composition



              Client      Composite       Origin
                          RESTful        Servers
                          service


      The “proxy” intermediate element which
       aggregates the resources provided by
       multiple servers plays the role of a
       composite RESTful service
      Can/Should we implement it with BPM?
©2010 - Cesare Pautasso                            27
Composite Resources

                                DELETE
                          PUT


                          GET
                                 C
                                         DELETE     DELETE
                           POST      PUT          PUT


                                     GET
                                            R     GET
                                                        S
                                         POST       POST


©2010 - Cesare Pautasso                                      28
Composite Resources
   The composite resource only aggregates the
    state of its component resources


                          C

                              R         S
                              State R   State S

©2010 - Cesare Pautasso                           29
Composite Resources
   The composite resource augments (or caches)
    the state of its component resources


                          C   State C


                                R         S
                                State R   State S

©2010 - Cesare Pautasso                             30
Composite Representation
                                    DELETE
                                  PUT
                                               DELETE

                 Composite        GET
                                        R    PUT
               Representation
                                    POST
                                                   S
                   C
                                             GET

                                               POST
                          LinkR

                          LinkS


©2010 - Cesare Pautasso                                 31
Composite Representation
                               Composite
                               Representation
                                                 Origin
                                                 Server



                          Client        Origin
                                       Servers
      A composite representation is interpreted by
       the client that follows its hyperlinks and
       aggregates the state of the referenced
       component resources
©2010 - Cesare Pautasso                                   32
Bringing it all together

                    Composite
                    Representation
                                      Composite    Origin
                                      RESTful     Servers
                                      service


        Client               Origin
                            Servers

      A composite representation can be
       produced by a composite service too

©2010 - Cesare Pautasso                                     33
Doodle Map Example

                    Composite
                    Representation
                                      Composite    Origin
                                      RESTful     Servers
                                      service


        Client               Origin
                            Servers

      Vote on a meeting place based on its
       geographic location

©2010 - Cesare Pautasso                                     34
Composite Resource

                                DELETE
                          PUT


                          GET
                                 C
                                         DELETE     DELETE
                           POST      PUT          PUT


                                     GET
                                            R     GET
                                                        S
                                         POST       POST


©2010 - Cesare Pautasso                                      35
Composite Resource

                                DELETE



                          GET
                                 C
                                                 DELETE
                           POST                PUT


                                     GET
                                           R   GET
                                                     S
                                                 POST


©2010 - Cesare Pautasso                                   36
Composite Representation


         DM                     DELETE
                                           GET
                                                 G
              LinkG
                          GET
                                 C
              LinkC                                  DELETE
                           POST                  PUT
              LinkD
                                     GET
                                           R     GET
                                                        S
                                                     POST


©2010 - Cesare Pautasso                                       37
Demo




©2009-2010 - Cesare Pautasso, Erik Wilde   38
Doodle Map Architecture
        Web Browser                                      Workflow            RESTful
                                                          Engine           Web Services


                                           RESTful API
                                                                              APIs
                                                                    GET

                                                                    POST
                                                                    GET




©2009-2010 - Cesare Pautasso, Erik Wilde                                                  39
DoodleMap Model




©2010 - Cesare Pautasso   40
Viewpoints



                          Control        Data
                          Flow           Flow
                                  Service
                                  Bindings

          JAVA            XPATH   XSLT   HTML   HTTP   …
©2010 - Cesare Pautasso                                    41
Control
       Flow




           Control Flow
           Dependency



©2010 - Cesare Pautasso   42
Service
   Bindings


        HTTP

        HTML

       XSLT

       XPATH

       JAVA

       …
©2010 - Cesare Pautasso   43
Data
      Flow




                Data Flow
                (Copy)



©2010 - Cesare Pautasso     44
Was it just a mashup?




                          Mashup
                                  REST
                             Composition

                   (It depends on the definition of Mashup)
©2010 - Cesare Pautasso                                       45
Moving state around
      Read-only vs. Read/Write
                                DELETE
                          PUT


                          GET
                                 C
                                         DELETE     DELETE
                           POST      PUT          PUT


                                     GET
                                            R     GET
                                                        S
                                         POST       POST


©2010 - Cesare Pautasso                                      46
Simply aggregating data
      Read-only vs. Read/write




                          GET
                                C


                                    GET
                                          R   GET
                                                    S


©2010 - Cesare Pautasso                                 47
Is your composition reusable?
      UI vs. API Composition


                    Composite
                                                   API
                    Representation
                                      Composite      Origin
                                      RESTful       Servers

                          UI
                                      service

                                               Reusable
        Client               Origin             services vs.
                            Servers             Reusable
                                                Widgets
©2010 - Cesare Pautasso                                        48
Single-Origin Sandbox
      Can you always do this
       from a web browser?

                    Composite
                    Representation
                                      Composite    Origin
                                      RESTful     Servers
                                      service


        Client               Origin
                            Servers

©2010 - Cesare Pautasso                                     49
Single-Origin Sandbox
      Security Policies on the client may not
       always allow it to aggregate data from
       multiple different sources
                    Composite
                    Representation
                                            Composite   N Origin
                                            RESTful     Servers
                                            service


        Client            1 Origin Server

      This will change very soon with HTML5
©2010 - Cesare Pautasso                                            50
Complementary
   Read-Only
                                          Read/Write


        UI                Mashup
                                 REST            API

                            Composition
                                            Reusable
               Situational                   Service
                 Sandboxed

©2010 - Cesare Pautasso                                51
Conclusions
      REST brings a new perspective and new
       problems to service composition
      RESTful services can be composed on the
       server by defining composite resources and
       on the client with composite representations
      Composing RESTful services helps to put
       the integration logic of a mashup into a
       reusable service API and keep it separate
       from its UI made out of reusable widgets
      RESTful Web service composition is
       different than mashups, but both can be
       built using BPM tools like JOpera
      GET http://www.jopera.org/
©2010 - Cesare Pautasso                               52
References
    Roy Fielding, Architectural Styles and the Design of Network-based
      Software Architectures, PhD Thesis, University of California, Irvine,
      2000
    Leonard Richardson, Sam Ruby, RESTful Web Services, O’Reilly,
      May 2007
    Jim Webber, Savas Parastatidis, Ian Robinson, REST in Practice:
      Hypermedia and Systems Architecture, O‘Reilly, 2010
    Subbu Allamaraju, RESTful Web Services Cookbook: Solutions for
      Improving Scalability and Simplicity, O’Reilly, 2010
    Stevan Tilkov, HTTP und REST, dpunkt Verlag, 2009,
      http://rest-http.info/
    Thomas Erl, Raj Balasubramanians, Cesare Pautasso, Benjamin
      Carlyle, SOA with REST, Prentice Hall, end of 2010
    Martin Fowler,
      Richardson Maturity Model: steps toward the glory of REST,
   http://martinfowler.com/articles/richardsonMaturityModel.html

©2009-2010 - Cesare Pautasso, Erik Wilde                                      53
Self-References
    Cesare Pautasso, Olaf Zimmermann, Frank 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.
    Cesare Pautasso and Erik Wilde. Why is the Web Loosely Coupled? A Multi-
     Faceted Metric for Service Design, Proc of the 18th International World
     Wide Web Conference (WWW2009), Madrid, Spain, April 2009.
    Cesare Pautasso, BPEL for REST, Proc. of the 6th International Conference
     on Business Process Management (BPM 2008), Milan, Italy, September
     2008.
    Cesare Pautasso, RESTful Web Service Composition with JOpera, Proc. Of
     the International Conference on Software Composition (SC 2009), Zurich,
     Switzerland, July 2009.
    Cesare Pautasso, Gustavo Alonso: From Web Service Composition to
     Megaprogramming In: Proceedings of the 5th VLDB Workshop on
     Technologies for E-Services (TES-04), Toronto, Canada, August 2004.


©2009-2010 - Cesare Pautasso, Erik Wilde                                         54
Leonard Richardson,              Raj Balasubramanians, Benjamin
          Sam Ruby,                        Carlyle,Thomas Erl, Cesare Pautasso,
          RESTful Web Services,            SOA with REST,
          O’Reilly, May 2007               Prentice Hall, end of 2010

©2009-2010 - Cesare Pautasso, Erik Wilde                                          55
Abstract Submission: Friday, July 16, 2010
©2009-2010 - Cesare Pautasso, Erik Wilde                       56

Mais conteúdo relacionado

Semelhante a RESTful Service Composition with JOpera

Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Cesare Pautasso
 
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Cesare Pautasso
 
4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...
4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...
4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...PROIDEA
 
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...Mateusz Kwasniewski
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registrydeimos
 
Cloud Foundry - How Service broker integrates with AppDirect to provide catal...
Cloud Foundry - How Service broker integrates with AppDirect to provide catal...Cloud Foundry - How Service broker integrates with AppDirect to provide catal...
Cloud Foundry - How Service broker integrates with AppDirect to provide catal...Nima Badiey
 
Media mosa architecture - features -10 june 2010
Media mosa   architecture - features -10 june 2010Media mosa   architecture - features -10 june 2010
Media mosa architecture - features -10 june 2010Andrii Podanenko
 
Intalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョンIntalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョンTomoaki Sawada
 
MediaMosa architecture & features
MediaMosa architecture & features MediaMosa architecture & features
MediaMosa architecture & features MediaMosa
 
Differentiating between web APIs, SOA, & integration …and why it matters
Differentiating between web APIs, SOA, & integration…and why it mattersDifferentiating between web APIs, SOA, & integration…and why it matters
Differentiating between web APIs, SOA, & integration …and why it mattersKim Clark
 
Layer 7: 2010 RSA Presentation on REST and Oauth Security
Layer 7: 2010 RSA Presentation on REST and Oauth SecurityLayer 7: 2010 RSA Presentation on REST and Oauth Security
Layer 7: 2010 RSA Presentation on REST and Oauth SecurityCA API Management
 
Atomic Transactions for the REST of us
Atomic Transactions for the REST of usAtomic Transactions for the REST of us
Atomic Transactions for the REST of usCesare Pautasso
 
Media Mosa : Architecture and Features, Utrecht, 10 June 2010
Media Mosa : Architecture and Features, Utrecht,  10 June 2010Media Mosa : Architecture and Features, Utrecht,  10 June 2010
Media Mosa : Architecture and Features, Utrecht, 10 June 2010Frans Ward
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-servicesrporwal
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financialRule_Financial
 

Semelhante a RESTful Service Composition with JOpera (20)

SOA2010 SOA with REST
SOA2010 SOA with RESTSOA2010 SOA with REST
SOA2010 SOA with REST
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
 
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009
 
SOA with REST
SOA with RESTSOA with REST
SOA with REST
 
REST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnapREST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnap
 
Rest ful security
Rest ful securityRest ful security
Rest ful security
 
4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...
4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...
4Developers 2015: Enterprise makeover. Be a good web citizen, deliver continu...
 
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registry
 
Cloud Foundry - How Service broker integrates with AppDirect to provide catal...
Cloud Foundry - How Service broker integrates with AppDirect to provide catal...Cloud Foundry - How Service broker integrates with AppDirect to provide catal...
Cloud Foundry - How Service broker integrates with AppDirect to provide catal...
 
Media mosa architecture - features -10 june 2010
Media mosa   architecture - features -10 june 2010Media mosa   architecture - features -10 june 2010
Media mosa architecture - features -10 june 2010
 
Modified REST Presentation
Modified REST PresentationModified REST Presentation
Modified REST Presentation
 
Intalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョンIntalio BPP 6.0のビジョン
Intalio BPP 6.0のビジョン
 
MediaMosa architecture & features
MediaMosa architecture & features MediaMosa architecture & features
MediaMosa architecture & features
 
Differentiating between web APIs, SOA, & integration …and why it matters
Differentiating between web APIs, SOA, & integration…and why it mattersDifferentiating between web APIs, SOA, & integration…and why it matters
Differentiating between web APIs, SOA, & integration …and why it matters
 
Layer 7: 2010 RSA Presentation on REST and Oauth Security
Layer 7: 2010 RSA Presentation on REST and Oauth SecurityLayer 7: 2010 RSA Presentation on REST and Oauth Security
Layer 7: 2010 RSA Presentation on REST and Oauth Security
 
Atomic Transactions for the REST of us
Atomic Transactions for the REST of usAtomic Transactions for the REST of us
Atomic Transactions for the REST of us
 
Media Mosa : Architecture and Features, Utrecht, 10 June 2010
Media Mosa : Architecture and Features, Utrecht,  10 June 2010Media Mosa : Architecture and Features, Utrecht,  10 June 2010
Media Mosa : Architecture and Features, Utrecht, 10 June 2010
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
 

Mais de Cesare Pautasso

Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteBeautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteCesare Pautasso
 
How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?Cesare Pautasso
 
Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?Cesare Pautasso
 
Disaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC TheoremDisaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC TheoremCesare Pautasso
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe Blockchain as a Software Connector
The Blockchain as a Software ConnectorCesare Pautasso
 
Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...Cesare Pautasso
 
Service Oriented Architectures and Web Services
Service Oriented Architectures and Web ServicesService Oriented Architectures and Web Services
Service Oriented Architectures and Web ServicesCesare Pautasso
 
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionExploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionCesare Pautasso
 
Real-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiReal-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiCesare Pautasso
 
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresTowards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresCesare Pautasso
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate MemberCesare Pautasso
 
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)Cesare Pautasso
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOperaCesare Pautasso
 
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Cesare Pautasso
 

Mais de Cesare Pautasso (19)

Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteBeautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 Keynote
 
How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?
 
Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?
 
Disaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC TheoremDisaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC Theorem
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe Blockchain as a Software Connector
The Blockchain as a Software Connector
 
Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...
 
Service Oriented Architectures and Web Services
Service Oriented Architectures and Web ServicesService Oriented Architectures and Web Services
Service Oriented Architectures and Web Services
 
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionExploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process Execution
 
Real-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiReal-time Mashups di Web Service Geografici
Real-time Mashups di Web Service Geografici
 
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresTowards Scalable Service Composition on Multicores
Towards Scalable Service Composition on Multicores
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate Member
 
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)
 
Mashups09
Mashups09Mashups09
Mashups09
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOpera
 
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)
 
Mashup Ecosystem
Mashup EcosystemMashup Ecosystem
Mashup Ecosystem
 
Mashup Atelier
Mashup AtelierMashup Atelier
Mashup Atelier
 
MetaCDN
MetaCDNMetaCDN
MetaCDN
 
Internet Mashups
Internet MashupsInternet Mashups
Internet Mashups
 

Último

Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 

Último (20)

Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 

RESTful Service Composition with JOpera

  • 1. RESTful Service Composition with JOpera Cesare Pautasso Faculty of Informatics, USI Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info http://twitter.com/pautasso 21.5.2010
  • 2. Abstract Next generation Web services technologies challenge the assumptions made by current standards for process-based service composition. For example, most existing RESTful Web service APIs cannot natively be composed using the WS-BPEL standard. In this talk we apply the notion of composition to RESTful services and discuss the conceptual relationship between business processes and stateful resources. Our goal is to enable lightweight access to service compositions published with a RESTful API. We show that the uniform interface and the hyper-linking capabilities of RESTful services provide an excellent abstraction for publishing proceses as a resource and exposing in a controlled way the execution state of a service composition. To do so, we present how to build a composite application (DoodleMap) out of some well-known, public and currently existing RESTful service APIs. ©2009-2010 - Cesare Pautasso, Erik Wilde 2
  • 3. From REST-* “ We believe there is huge potential to marrying REST with workflow and BPM. http://www.jboss.org/reststar/specifications/workflow.html […] Combined with the architecture of the Web, a workflow service can provide both a truly simple, portable, and flexible way to build workflow driven integrations and ” applications. ©2010 - Cesare Pautasso 3
  • 4. WS-BPEL Primitives Web <receive> <invoke> Service <reply> <invoke> Web <receive> Service  The workflow language natively supports the RPC or message-based connectors ©2010 - Cesare Pautasso 4
  • 5. WS-BPEL Primitives Web <receive> <invoke> Service <reply>  Easy to map this to HTTP! Web <invoke> <receive> Service ©2010 - Cesare Pautasso 5
  • 6. BPEL and WSDL 2.0 WSDL 2.0 HTTP Binding can wrap RESTful Web Services (WS-BPEL 2.0 does not support WSDL 2.0) ©2009-2010 - Cesare Pautasso, Erik Wilde 6
  • 7. RESTful APIs… …do not use WSDL ©2010 - Cesare Pautasso 7
  • 8. WS-BPEL Primitives Web <receive> <invoke> Service <reply>  Easy to map this to HTTP? Web <invoke> <receive> Service  We need something else ©2010 - Cesare Pautasso 8
  • 9. From REST-* “ We believe there is huge potential to marrying REST with workflow and BPM. http://www.jboss.org/reststar/specifications/workflow.html  The HATEOAS (hypermedia and linking) principal of REST is logically a dynamic state machine and fits very well with how workflow and BPM systems are designed.  Combined with the architecture of the Web, a workflow service can provide both a truly simple, portable, and flexible way to build workflow driven integrations and applications. ©2010 - Cesare Pautasso 9
  • 10. Outline 1. Introduction to RESTful Web Services 2. Defining RESTful Service Composition 3. JOpera Demo 4. More than Mashups? ©2009-2010 - Cesare Pautasso, Erik Wilde 10
  • 11. REST in one slide  Web Services expose their data and functionality trough PUT resources identified by URI R  Uniform Interface Principle: GET Clients interact with resources POST through a fix set of verbs. DELETE Example HTTP: GET (read), POST (create), PUT (update), DELETE  Multiple representations for the same resource  Hyperlinks model resource relationships and valid state transitions for dynamic protocol description and discovery ©2010 - Cesare Pautasso 11
  • 12. Design Methodology 1. Identify resources to be exposed as services (e.g., yearly risk report, book DELETE catalog, purchase order, open bugs, POST polls and votes) GET PUT 2. Model relationships (e.g., containment, reference, state transitions) between /loan     resources with hyperlinks that can be followed to get more details (or perform /balance     state transitions) /client     3. Define “nice” URIs to address the resources /book     4. Understand what it means to do a GET, POST, PUT, DELETE for each resource /order  ?   (and whether it is allowed or not) 5. Design and document resource representations /soap     6. Implement and deploy on Web server 7. Test with a Web browser ©2009-2010 - Cesare Pautasso, Erik Wilde 12
  • 13. Design Space M Representations (Variable) ©2009-2010 - Cesare Pautasso, Erik Wilde 13
  • 14. Simple Doodle API Example 1. Resources: DELETE polls and votes POST 2. Containment Relationship: GET PUT poll /poll     {id1} /poll/{id}     vote /poll/{id}/vote     {id4} /poll/{id}/vote/{id}    ? {id5} 3. URIs embed IDs of “child” instance resources 4. POST on the container is used to {id2} create child resources 5. PUT/DELETE for updating and {id3} removing child resources ©2009-2010 - Cesare Pautasso, Erik Wilde 14
  • 15. Simple Doodle API Example 1. Creating a poll (transfer the state of a new poll on the Doodle service) /poll /poll/090331x /poll/090331x/vote POST /poll GET /poll/090331x <options>A,B,C</options> 200 OK 201 Created <options>A,B,C</options> Location: /poll/090331x <votes href=“/vote”/> 2. Reading a poll (transfer the state of the poll from the Doodle service) ©2009-2010 - Cesare Pautasso, Erik Wilde 15
  • 16. Simple Doodle API Example  Participating in a poll by creating a new vote sub-resource /poll /poll/090331x /poll/090331x/vote /poll/090331x/vote/1 POST /poll/090331x/vote GET /poll/090331x <name>C. Pautasso</name> <choice>B</choice> 200 OK <options>A,B,C</options> 201 Created <votes><vote id=“1”> Location: <name>C. Pautasso</name> /poll/090331x/vote/1 <choice>B</choice> </vote></votes> ©2009-2010 - Cesare Pautasso, Erik Wilde 16
  • 17. Simple Doodle API Example  Existing votes can be updated (access control headers not shown) /poll /poll/090331x /poll/090331x/vote /poll/090331x/vote/1 PUT /poll/090331x/vote/1 GET /poll/090331x <name>C. Pautasso</name> <choice>C</choice> 200 OK <options>A,B,C</options> 200 OK <votes><vote id=“/1”> <name>C. Pautasso</name> <choice>C</choice> </vote></votes> ©2009-2010 - Cesare Pautasso, Erik Wilde 17
  • 18. Simple Doodle API Example  Polls can be deleted once a decision has been made /poll /poll/090331x /poll/090331x/vote /poll/090331x/vote/1 DELETE /poll/090331x GET /poll/090331x 200 OK 404 Not Found ©2009-2010 - Cesare Pautasso, Erik Wilde 18
  • 19. Real Doodle Demo • Info on the real Doodle API: http://doodle.com/xsd1/RESTfulDoodle.pdf • Lightweight demo with Poster Firefox Extension: http://addons.mozilla.org/en-US/firefox/addon/2691 ©2009-2010 - Cesare Pautasso, Erik Wilde 19
  • 20. Different software connectors RPC ESB WWW ©2010 - Cesare Pautasso 20
  • 21. REST Architectural Elements Client/Server Layered Stateless Communication Cache Proxy User Agent Origin Server Gateway Connector (HTTP) Cache ©2009-2010 - Cesare Pautasso, Erik Wilde 21
  • 22. Basic Setup HTTP User Agent Origin Server Adding Caching HTTP HTTP Caching Origin Server User Agent Caching User Agent Origin Server HTTP Caching Caching User Agent Origin Server ©2009-2010 - Cesare Pautasso, Erik Wilde 22
  • 23. Proxy or Gateway? Intermediaries forward (and may translate) requests and responses HTTP HTTP Client Proxy Origin Server A proxy is chosen by the Client (for caching, or access control) HTTP HTTP Client Gateway Origin Server The use of a gateway (or reverse proxy) is imposed by the server ©2009-2010 - Cesare Pautasso, Erik Wilde 23
  • 24. What about composition?  The basic REST design  WS-BPEL is the standard elements do not take Web service composition language. Business process composition into account models are used to specify how a collection of services HTTP is orchestrated into a composite service User Agent Origin Server  Can we apply WS-BPEL to RESTful services? HTTP Origin Server User Agent ? Origin Server ©2009-2010 - Cesare Pautasso, Erik Wilde 24
  • 25. REST Scalability Cache Proxy/Gateway Origin Server Clients  One example of REST middleware is to help with the scalability of a server, which may need to service a very large number of clients ©2010 - Cesare Pautasso 25
  • 26. REST Composition Proxy/Gateway Origin Server Clients  Composition shifts the attention to the client which should consume and aggregate from many servers ©2010 - Cesare Pautasso 26
  • 27. REST Composition Client Composite Origin RESTful Servers service  The “proxy” intermediate element which aggregates the resources provided by multiple servers plays the role of a composite RESTful service  Can/Should we implement it with BPM? ©2010 - Cesare Pautasso 27
  • 28. Composite Resources DELETE PUT GET C DELETE DELETE POST PUT PUT GET R GET S POST POST ©2010 - Cesare Pautasso 28
  • 29. Composite Resources  The composite resource only aggregates the state of its component resources C R S State R State S ©2010 - Cesare Pautasso 29
  • 30. Composite Resources  The composite resource augments (or caches) the state of its component resources C State C R S State R State S ©2010 - Cesare Pautasso 30
  • 31. Composite Representation DELETE PUT DELETE Composite GET R PUT Representation POST S C GET POST LinkR LinkS ©2010 - Cesare Pautasso 31
  • 32. Composite Representation Composite Representation Origin Server Client Origin Servers  A composite representation is interpreted by the client that follows its hyperlinks and aggregates the state of the referenced component resources ©2010 - Cesare Pautasso 32
  • 33. Bringing it all together Composite Representation Composite Origin RESTful Servers service Client Origin Servers  A composite representation can be produced by a composite service too ©2010 - Cesare Pautasso 33
  • 34. Doodle Map Example Composite Representation Composite Origin RESTful Servers service Client Origin Servers  Vote on a meeting place based on its geographic location ©2010 - Cesare Pautasso 34
  • 35. Composite Resource DELETE PUT GET C DELETE DELETE POST PUT PUT GET R GET S POST POST ©2010 - Cesare Pautasso 35
  • 36. Composite Resource DELETE GET C DELETE POST PUT GET R GET S POST ©2010 - Cesare Pautasso 36
  • 37. Composite Representation DM DELETE GET G LinkG GET C LinkC DELETE POST PUT LinkD GET R GET S POST ©2010 - Cesare Pautasso 37
  • 38. Demo ©2009-2010 - Cesare Pautasso, Erik Wilde 38
  • 39. Doodle Map Architecture Web Browser Workflow RESTful Engine Web Services RESTful API APIs GET POST GET ©2009-2010 - Cesare Pautasso, Erik Wilde 39
  • 40. DoodleMap Model ©2010 - Cesare Pautasso 40
  • 41. Viewpoints Control Data Flow Flow Service Bindings JAVA XPATH XSLT HTML HTTP … ©2010 - Cesare Pautasso 41
  • 42. Control Flow Control Flow Dependency ©2010 - Cesare Pautasso 42
  • 43. Service Bindings HTTP HTML XSLT XPATH JAVA … ©2010 - Cesare Pautasso 43
  • 44. Data Flow Data Flow (Copy) ©2010 - Cesare Pautasso 44
  • 45. Was it just a mashup? Mashup REST Composition (It depends on the definition of Mashup) ©2010 - Cesare Pautasso 45
  • 46. Moving state around  Read-only vs. Read/Write DELETE PUT GET C DELETE DELETE POST PUT PUT GET R GET S POST POST ©2010 - Cesare Pautasso 46
  • 47. Simply aggregating data  Read-only vs. Read/write GET C GET R GET S ©2010 - Cesare Pautasso 47
  • 48. Is your composition reusable?  UI vs. API Composition Composite API Representation Composite Origin RESTful Servers UI service  Reusable Client Origin services vs. Servers Reusable Widgets ©2010 - Cesare Pautasso 48
  • 49. Single-Origin Sandbox  Can you always do this from a web browser? Composite Representation Composite Origin RESTful Servers service Client Origin Servers ©2010 - Cesare Pautasso 49
  • 50. Single-Origin Sandbox  Security Policies on the client may not always allow it to aggregate data from multiple different sources Composite Representation Composite N Origin RESTful Servers service Client 1 Origin Server  This will change very soon with HTML5 ©2010 - Cesare Pautasso 50
  • 51. Complementary Read-Only Read/Write UI Mashup REST API Composition Reusable Situational Service Sandboxed ©2010 - Cesare Pautasso 51
  • 52. Conclusions  REST brings a new perspective and new problems to service composition  RESTful services can be composed on the server by defining composite resources and on the client with composite representations  Composing RESTful services helps to put the integration logic of a mashup into a reusable service API and keep it separate from its UI made out of reusable widgets  RESTful Web service composition is different than mashups, but both can be built using BPM tools like JOpera  GET http://www.jopera.org/ ©2010 - Cesare Pautasso 52
  • 53. References  Roy Fielding, Architectural Styles and the Design of Network-based Software Architectures, PhD Thesis, University of California, Irvine, 2000  Leonard Richardson, Sam Ruby, RESTful Web Services, O’Reilly, May 2007  Jim Webber, Savas Parastatidis, Ian Robinson, REST in Practice: Hypermedia and Systems Architecture, O‘Reilly, 2010  Subbu Allamaraju, RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity, O’Reilly, 2010  Stevan Tilkov, HTTP und REST, dpunkt Verlag, 2009, http://rest-http.info/  Thomas Erl, Raj Balasubramanians, Cesare Pautasso, Benjamin Carlyle, SOA with REST, Prentice Hall, end of 2010  Martin Fowler, Richardson Maturity Model: steps toward the glory of REST, http://martinfowler.com/articles/richardsonMaturityModel.html ©2009-2010 - Cesare Pautasso, Erik Wilde 53
  • 54. Self-References  Cesare Pautasso, Olaf Zimmermann, Frank 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.  Cesare Pautasso and Erik Wilde. Why is the Web Loosely Coupled? A Multi- Faceted Metric for Service Design, Proc of the 18th International World Wide Web Conference (WWW2009), Madrid, Spain, April 2009.  Cesare Pautasso, BPEL for REST, Proc. of the 6th International Conference on Business Process Management (BPM 2008), Milan, Italy, September 2008.  Cesare Pautasso, RESTful Web Service Composition with JOpera, Proc. Of the International Conference on Software Composition (SC 2009), Zurich, Switzerland, July 2009.  Cesare Pautasso, Gustavo Alonso: From Web Service Composition to Megaprogramming In: Proceedings of the 5th VLDB Workshop on Technologies for E-Services (TES-04), Toronto, Canada, August 2004. ©2009-2010 - Cesare Pautasso, Erik Wilde 54
  • 55. Leonard Richardson, Raj Balasubramanians, Benjamin Sam Ruby, Carlyle,Thomas Erl, Cesare Pautasso, RESTful Web Services, SOA with REST, O’Reilly, May 2007 Prentice Hall, end of 2010 ©2009-2010 - Cesare Pautasso, Erik Wilde 55
  • 56. Abstract Submission: Friday, July 16, 2010 ©2009-2010 - Cesare Pautasso, Erik Wilde 56