SlideShare a Scribd company logo
1 of 47
Techniques for
Composing REST services

            Cesare Pautasso
         Faculty of Informatics
    University of Lugano, Switzerland

          c.pautasso@ieee.org
       http://www.pautasso.info
Abstract
            Novel trends in Web services technology challenge
             the assumptions made by current standards for
             process-based service composition. For example,
             most existing RESTful Web service APIs (which do
             not rely on the Web Service Description Language),
             cannot natively be composed using the WS-BPEL
             language.
            In this talk we introduce the problem of composing
             RESTful services and compare it to Web 2.0 service
             mashups. We cover several real-world examples
             demonstrating how existing composition languages
             can be evolved to cope with REST. We conclude by
             showing that the uniform interface and hyper-
             linking capabilities of RESTful services provides an
             excellent abstraction for exposing in a controlled
             way the state of business process as a resource.
©2009 - Cesare Pautasso                                             2
About Cesare Pautasso
          Assistant Professor at the Faculty of Informatics,
           University of Lugano, Switzerland (since Sept 2007)
          Research Projects:
           SOSOA – Self Organizing Service Oriented Architectures
                           -
           CLAVOS – Continuous Lifelong Analysis and Verification of
              Open Services
           BPEL for REST
          Researcher at IBM Zurich Research Lab (2007)
          Post Doc at ETH Zürich
               -
           Software:
              JOpera: Process Support for more than Web services
              http://www.jopera.org/
          Ph.D. at ETH Zürich, Switzerland (2004)

            Representations:
             http://www.pautasso.info/ (Web)
             http://twitter.com/pautasso/ (Twitter Feed)

©2009 - Cesare Pautasso                                                 3
Why Composition?




          Composition is the key SOA principle
           with the goal of enabling


              service reuse
©2009 - Cesare Pautasso                           4
REST and Reuse

         Uniform Interface (Reuse Contract)
         Status Codes (Reuse Metadata)
         Representations (Reuse Media Types)
         Middleware (Reuse caching, security,
          load balancing, proxies components)




©2009 - Cesare Pautasso                          5
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
©2009 - Cesare Pautasso                                   6
REST and Reuse

         Uniform Interface (Reuse Contract)
         Status Codes (Reuse Metadata)
         Representations (Reuse Media Types)
         Middleware (Reuse caching, security,
          load balancing, proxies components)

      Yes, but what about reusing entire RESTful
       services?



©2009 - Cesare Pautasso                             7
RESTful Composition Techniques


     1. Defining RESTful service composition

     2. Example: DoodleMap

     3. What about mashups?

     4. BPM and REST



©2009 - Cesare Pautasso                        8
REST Architectural Elements
      Client/Server          Layered     Stateless Communication   Cache




                                 Proxy
                User Agent                             Origin Server

                                           Gateway


                             Connector (HTTP)        Cache


©2009 - Cesare Pautasso                                                    9
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 - Cesare Pautasso                                                           10
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 - Cesare Pautasso                                                 11
REST Middleware for 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

©2009 - Cesare Pautasso                                      12
REST Middleware for Composition




                                    Proxy/Gateway   Origin
                                                    Server
                          Clients


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


©2009 - Cesare Pautasso                                      13
REST Middleware for Composition



              Client      Composite       Origin
                           RESTful       Servers
                           service


      The “proxy” intermediate element which
       aggregates the resources provided by
       multiple servers plays the role of the
       composition controller of a composite
       RESTful service
©2009 - Cesare Pautasso                            14
Composite Resources

                                DELETE
                          PUT


                          GET
                                 C
                                         DELETE     DELETE
                           POST      PUT          PUT


                                     GET
                                            R     GET
                                                        S
                                         POST       POST


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


                          C

                              R         S
                              State R   State S

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


                          C   State C


                                R         S
                                State R   State S

©2009 - Cesare Pautasso                             17
Enter HATEOAS
  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
©2009 - Cesare Pautasso                                   18
Composite Representations
                                        DELETE
                                  PUT
                                                       DELETE

                Composite         GET
                                          R      PUT
               Representation
                                    POST         GET
                                                         S
                   C
                                                   POST
                          LinkR

                          LinkS


©2009 - Cesare Pautasso                                         19
Composite Representation Pattern
                               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
©2009 - Cesare Pautasso                                   20
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

©2009 - Cesare Pautasso                                     21
Doodle Map Example

                    Composite
                    Representation
                                      Composite    Origin
                                       RESTful    Servers
                                       service


        Client               Origin
                            Servers

      Vote on a meeting place based on its
       geographic location

©2009 - Cesare Pautasso                                     22
1. Composite Resource

                                DELETE
                          PUT


                          GET
                                 C
                                         DELETE     DELETE
                           POST      PUT          PUT


                                     GET
                                            R     GET
                                                        S
                                         POST       POST


©2009 - Cesare Pautasso                                      23
1. Composite Resource

                                DELETE



                          GET
                                 C
                                                 DELETE
                           POST                PUT


                                     GET
                                           R   GET
                                                     S
                                                 POST


©2009 - Cesare Pautasso                                   24
2. Composite Representation


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


©2009 - Cesare Pautasso                                       25
Demo
©2009 - Cesare Pautasso   26
Was it just a Mashup?




                          Mashup
                                  REST
                             Composition

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


                          GET
                                 C
                                         DELETE     DELETE
                           POST      PUT          PUT


                                     GET
                                            R     GET
                                                        S
                                         POST       POST


©2009 - Cesare Pautasso                                      28
Simply aggregating data (feeds)
      Read-only vs. Read/write




                          GET
                                C


                                    GET
                                          R   GET
                                                    S


©2009 - Cesare Pautasso                                 29
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
©2009 - Cesare Pautasso                                        30
Single-Origin Sandbox
      Can you always do this
       from a web browser?

                    Composite
                    Representation
                                      Composite    Origin
                                       RESTful    Servers
                                       service


        Client               Origin
                            Servers

©2009 - Cesare Pautasso                                     31
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



©2009 - Cesare Pautasso                                            32
Complementary
   Read-Only
                                          Read/Write


        UI                Mashup
                                 REST            API

                            Composition
                                            Reusable
               Situational                    Service
                 Sandboxed

©2009 - Cesare Pautasso                                 33
RESTful Composition Techniques


     1. Defining RESTful service composition

     2. Example: DoodleMap

     3. What about mashups?

     4. BPM and REST



©2009 - Cesare Pautasso                        34
Web Service Composition Today

                 The WS-BPEL process
               model is layered on top of                  WS-BPEL 2.0
               the service model defined
               by WSDL 1.1. […]                             WSDL 1.1
               Both the process and its
               partners are exposed as
               WSDL services

                          [BPEL 2.0 Standard, Section 3]



©2009 - Cesare Pautasso                                                  35
RESTful Web Services APIs…



                          WSDL 1.1



                          …do not
                           use
                           WSDL
                           1.1

©2009 - Cesare Pautasso              36
BPEL/WSDL 2.0
          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

©2009 - Cesare Pautasso                                              37
BPM         RESTful
              Workflow    Web Service
             Languages    Composition



©2009 - Cesare Pautasso                 38
Solutions
                                                       BPM              RESTful
                                                     Workflow         Web Service

    1. Abstract Workflow                            Languages         Composition



            Service invocation technology does not matter
    2. Concrete Workflow
            Expose service invocation              BPM     RESTful
                                                  Workflow Web Service
                                                 LanguagesComposition
             technologies as explicit constructs
             in the workflow language
    3. RESTful Workflow
                                                                   BPM
                                                                   RESTful

            Workflow as one kind of resource                    Workflow
                                                                 Web Service
                                                                Languages
                                                                 Composition


             exposed by a RESTful service
©2009 - Cesare Pautasso                                                             39
BPEL/WSDL 2.0
          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

©2009 - Cesare Pautasso                                              40
BPEL for REST

    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>
                             ...

©2009 - Cesare Pautasso                                          41
BPEL for REST
        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
©2009 - Cesare Pautasso                                                    42
RESTful Workflows

                          PUT                P

                     GET
                                R
                          POST
                                    DELETE
   Use the resource interface
   abstraction to publish
   the state of the workflow

©2009 - Cesare Pautasso                          43
DoodleMap as RESTful workflow




©2009 - Cesare Pautasso           44
Conclusion


      Applying the SOA composition principle to
       REST gives interesting results
      Thanks to hyperlinks, REST brings a new
       (more dynamic and loosely coupled)
       twist to SOA composition
      Composing RESTful services helps to build
       mashups, but is different
      A RESTful API is the perfect abstraction for
       publishing the state of a workflow


©2009 - Cesare Pautasso                               45
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
     C. Pautasso, Composing RESTful Services with JOpera,
      In: Proc. of the International Conference on Software
      Composition (SC2009), July 2009, Zurich, Switzerland.
©                                                                     46
Raj Balasubramanian,
                          Benjamin Carlyle,
                          Thomas Erl,
                          Cesare Pautasso,
                          SOA with REST,
                          Prentice Hall,
                          to appear in 2010




©2009 - Cesare Pautasso                          47

More Related Content

Similar to Techniques for Composing REST services - SOA Symposium 2009

RESTful Service Composition with JOpera
RESTful Service Composition with JOperaRESTful Service Composition with JOpera
RESTful Service Composition with JOperaCesare Pautasso
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOperaCesare Pautasso
 
SOA2010 SOA with REST
SOA2010 SOA with RESTSOA2010 SOA with REST
SOA2010 SOA with RESTCesare Pautasso
 
Toward data driven programming for RESTful Linked Data
Toward data driven programming for RESTful Linked DataToward data driven programming for RESTful Linked Data
Toward data driven programming for RESTful Linked DataSteffen StadtmĂĽller
 
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 DataSnapEmbarcadero Technologies
 
Rest api-interview
Rest api-interviewRest api-interview
Rest api-interviewMohammed Kemal
 
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
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningArul ChristhuRaj Alphonse
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech SessionPravin Vaja
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registrydeimos
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financialRule_Financial
 
Embedding Jaspersoft into your PHP application
Embedding Jaspersoft into your PHP applicationEmbedding Jaspersoft into your PHP application
Embedding Jaspersoft into your PHP applicationMariano Luna
 
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
 
Building+restful+webservice
Building+restful+webserviceBuilding+restful+webservice
Building+restful+webservicelonegunman
 

Similar to Techniques for Composing REST services - SOA Symposium 2009 (20)

RESTful Service Composition with JOpera
RESTful Service Composition with JOperaRESTful Service Composition with JOpera
RESTful Service Composition with JOpera
 
SOA with REST
SOA with RESTSOA with REST
SOA with REST
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOpera
 
SOA2010 SOA with REST
SOA2010 SOA with RESTSOA2010 SOA with REST
SOA2010 SOA with REST
 
Toward data driven programming for RESTful Linked Data
Toward data driven programming for RESTful Linked DataToward data driven programming for RESTful Linked Data
Toward data driven programming for RESTful Linked Data
 
NetWeaver Gateway- Introduction to REST
NetWeaver Gateway- Introduction to RESTNetWeaver Gateway- Introduction to REST
NetWeaver Gateway- Introduction to 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 api-interview
Rest api-interviewRest api-interview
Rest api-interview
 
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
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
Rest Component
Rest ComponentRest Component
Rest Component
 
Weekly Tech Session
Weekly Tech SessionWeekly Tech Session
Weekly Tech Session
 
Paul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA RegistryPaul Fremantle Restful SOA Registry
Paul Fremantle Restful SOA Registry
 
How to use rest component
How to use rest componentHow to use rest component
How to use rest component
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Embedding Jaspersoft into your PHP application
Embedding Jaspersoft into your PHP applicationEmbedding Jaspersoft into your PHP application
Embedding Jaspersoft into your PHP application
 
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
 
Building+restful+webservice
Building+restful+webserviceBuilding+restful+webservice
Building+restful+webservice
 

More from 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
 
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
 
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
 

More from 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)
 
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
 
Mashups09
Mashups09Mashups09
Mashups09
 
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
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Techniques for Composing REST services - SOA Symposium 2009

  • 1. Techniques for Composing REST services Cesare Pautasso Faculty of Informatics University of Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info
  • 2. Abstract  Novel trends in Web services technology challenge the assumptions made by current standards for process-based service composition. For example, most existing RESTful Web service APIs (which do not rely on the Web Service Description Language), cannot natively be composed using the WS-BPEL language.  In this talk we introduce the problem of composing RESTful services and compare it to Web 2.0 service mashups. We cover several real-world examples demonstrating how existing composition languages can be evolved to cope with REST. We conclude by showing that the uniform interface and hyper- linking capabilities of RESTful services provides an excellent abstraction for exposing in a controlled way the state of business process as a resource. ©2009 - Cesare Pautasso 2
  • 3. About Cesare Pautasso  Assistant Professor at the Faculty of Informatics, University of Lugano, Switzerland (since Sept 2007) Research Projects:  SOSOA – Self Organizing Service Oriented Architectures -  CLAVOS – Continuous Lifelong Analysis and Verification of Open Services  BPEL for REST  Researcher at IBM Zurich Research Lab (2007)  Post Doc at ETH ZĂĽrich -  Software: JOpera: Process Support for more than Web services http://www.jopera.org/  Ph.D. at ETH ZĂĽrich, Switzerland (2004)  Representations: http://www.pautasso.info/ (Web) http://twitter.com/pautasso/ (Twitter Feed) ©2009 - Cesare Pautasso 3
  • 4. Why Composition?  Composition is the key SOA principle with the goal of enabling service reuse ©2009 - Cesare Pautasso 4
  • 5. REST and Reuse  Uniform Interface (Reuse Contract)  Status Codes (Reuse Metadata)  Representations (Reuse Media Types)  Middleware (Reuse caching, security, load balancing, proxies components) ©2009 - Cesare Pautasso 5
  • 6. 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 ©2009 - Cesare Pautasso 6
  • 7. REST and Reuse  Uniform Interface (Reuse Contract)  Status Codes (Reuse Metadata)  Representations (Reuse Media Types)  Middleware (Reuse caching, security, load balancing, proxies components)  Yes, but what about reusing entire RESTful services? ©2009 - Cesare Pautasso 7
  • 8. RESTful Composition Techniques 1. Defining RESTful service composition 2. Example: DoodleMap 3. What about mashups? 4. BPM and REST ©2009 - Cesare Pautasso 8
  • 9. REST Architectural Elements Client/Server Layered Stateless Communication Cache Proxy User Agent Origin Server Gateway Connector (HTTP) Cache ©2009 - Cesare Pautasso 9
  • 10. 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 - Cesare Pautasso 10
  • 11. 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 - Cesare Pautasso 11
  • 12. REST Middleware for 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 ©2009 - Cesare Pautasso 12
  • 13. REST Middleware for Composition Proxy/Gateway Origin Server Clients  Composition shifts the attention to the client which should consume and aggregate from many servers ©2009 - Cesare Pautasso 13
  • 14. REST Middleware for Composition Client Composite Origin RESTful Servers service  The “proxy” intermediate element which aggregates the resources provided by multiple servers plays the role of the composition controller of a composite RESTful service ©2009 - Cesare Pautasso 14
  • 15. Composite Resources DELETE PUT GET C DELETE DELETE POST PUT PUT GET R GET S POST POST ©2009 - Cesare Pautasso 15
  • 16. Composite Resources  The composite resource only aggregates the state of its component resources C R S State R State S ©2009 - Cesare Pautasso 16
  • 17. Composite Resources  The composite resource augments (or caches) the state of its component resources C State C R S State R State S ©2009 - Cesare Pautasso 17
  • 18. Enter HATEOAS  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 ©2009 - Cesare Pautasso 18
  • 19. Composite Representations DELETE PUT DELETE Composite GET R PUT Representation POST GET S C POST LinkR LinkS ©2009 - Cesare Pautasso 19
  • 20. Composite Representation Pattern 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 ©2009 - Cesare Pautasso 20
  • 21. 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 ©2009 - Cesare Pautasso 21
  • 22. Doodle Map Example Composite Representation Composite Origin RESTful Servers service Client Origin Servers  Vote on a meeting place based on its geographic location ©2009 - Cesare Pautasso 22
  • 23. 1. Composite Resource DELETE PUT GET C DELETE DELETE POST PUT PUT GET R GET S POST POST ©2009 - Cesare Pautasso 23
  • 24. 1. Composite Resource DELETE GET C DELETE POST PUT GET R GET S POST ©2009 - Cesare Pautasso 24
  • 25. 2. Composite Representation DM DELETE GET G LinkG GET C LinkC DELETE POST PUT LinkD GET R GET S POST ©2009 - Cesare Pautasso 25
  • 26. Demo ©2009 - Cesare Pautasso 26
  • 27. Was it just a Mashup? Mashup REST Composition (It depends on the definition of Mashup) ©2009 - Cesare Pautasso 27
  • 28. Moving state around  Read-only vs. Read/Write DELETE PUT GET C DELETE DELETE POST PUT PUT GET R GET S POST POST ©2009 - Cesare Pautasso 28
  • 29. Simply aggregating data (feeds)  Read-only vs. Read/write GET C GET R GET S ©2009 - Cesare Pautasso 29
  • 30. 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 ©2009 - Cesare Pautasso 30
  • 31. Single-Origin Sandbox  Can you always do this from a web browser? Composite Representation Composite Origin RESTful Servers service Client Origin Servers ©2009 - Cesare Pautasso 31
  • 32. 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 ©2009 - Cesare Pautasso 32
  • 33. Complementary Read-Only Read/Write UI Mashup REST API Composition Reusable Situational Service Sandboxed ©2009 - Cesare Pautasso 33
  • 34. RESTful Composition Techniques 1. Defining RESTful service composition 2. Example: DoodleMap 3. What about mashups? 4. BPM and REST ©2009 - Cesare Pautasso 34
  • 35. Web Service Composition Today The WS-BPEL process model is layered on top of WS-BPEL 2.0 the service model defined by WSDL 1.1. […] WSDL 1.1 Both the process and its partners are exposed as WSDL services [BPEL 2.0 Standard, Section 3] ©2009 - Cesare Pautasso 35
  • 36. RESTful Web Services APIs… WSDL 1.1 …do not use WSDL 1.1 ©2009 - Cesare Pautasso 36
  • 37. BPEL/WSDL 2.0 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 ©2009 - Cesare Pautasso 37
  • 38. BPM RESTful Workflow Web Service Languages Composition ©2009 - Cesare Pautasso 38
  • 39. Solutions BPM RESTful Workflow Web Service 1. Abstract Workflow Languages Composition  Service invocation technology does not matter 2. Concrete Workflow  Expose service invocation BPM RESTful Workflow Web Service LanguagesComposition technologies as explicit constructs in the workflow language 3. RESTful Workflow BPM RESTful  Workflow as one kind of resource Workflow Web Service Languages Composition exposed by a RESTful service ©2009 - Cesare Pautasso 39
  • 40. BPEL/WSDL 2.0 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 ©2009 - Cesare Pautasso 40
  • 41. BPEL for REST 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> ... ©2009 - Cesare Pautasso 41
  • 42. BPEL for REST  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 ©2009 - Cesare Pautasso 42
  • 43. RESTful Workflows PUT P GET R POST DELETE Use the resource interface abstraction to publish the state of the workflow ©2009 - Cesare Pautasso 43
  • 44. DoodleMap as RESTful workflow ©2009 - Cesare Pautasso 44
  • 45. Conclusion  Applying the SOA composition principle to REST gives interesting results  Thanks to hyperlinks, REST brings a new (more dynamic and loosely coupled) twist to SOA composition  Composing RESTful services helps to build mashups, but is different  A RESTful API is the perfect abstraction for publishing the state of a workflow ©2009 - Cesare Pautasso 45
  • 46. 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  C. Pautasso, Composing RESTful Services with JOpera, In: Proc. of the International Conference on Software Composition (SC2009), July 2009, Zurich, Switzerland. © 46
  • 47. Raj Balasubramanian, Benjamin Carlyle, Thomas Erl, Cesare Pautasso, SOA with REST, Prentice Hall, to appear in 2010 ©2009 - Cesare Pautasso 47