Techniques for Composing REST services



Similar documents
Some REST Design Patterns (and Anti-Patterns)

BPMN for REST. Cesare Pautasso Faculty of Informatics, USI Lugano, Switzerland

REST vs. SOAP: Making the Right Architectural Decision

Understanding Service-Orientation Part II: The Principles

Session 6 Patterns and best practices in SOA/REST

Service Computing: Basics Monica Scannapieco

Building Web-based Infrastructures for Smart Meters

SOA and Virtualization Technologies (ENCS 691K Chapter 2)

Service Oriented Architecture

Principles and Foundations of Web Services: An Holistic View (Technologies, Business Drivers, Models, Architectures and Standards)

Web Services Software Architecture

Introduction to Service Oriented Architectures (SOA)

Enterprise Application Designs In Relation to ERP and SOA

The Service Revolution software engineering without programming languages

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

Service Oriented Architecture 1 COMPILED BY BJ

Method of Unified Communications and Collaboration Service in Open Service Platform based on RESTful Web Services

Six Strategies for Building High Performance SOA Applications

Service-Oriented Architecture and Software Engineering

A standards-based approach to application integration

Lesson 18 Web Services and. Service Oriented Architectures

Service-Oriented Architectures

SOA CERTIFIED JAVA DEVELOPER (7 Days)

AN APPROACH TO DEVELOPING BUSINESS PROCESSES WITH WEB SERVICES IN GRID

Web Application Development for the SOA Age Thinking in XML

Methods and tools for data and software integration Enterprise Service Bus

SOA Architect Certification Self-Study Kit Bundle

How To Understand A Services-Oriented Architecture

SOA, case Google. Faculty of technology management Information Technology Service Oriented Communications CT30A8901.

Process Execution Engine

Getting Started with Service- Oriented Architecture (SOA) Terminology

Service-oriented architecture in e-commerce applications

A Quick Introduction to SOA

Service Oriented Architecture

Analyses on functional capabilities of BizTalk Server, Oracle BPEL Process Manger and WebSphere Process Server for applications in Grid middleware

Service Oriented Architecture (SOA) Architecture, Governance, Standards and Technologies

Oracle SOA Reference Architecture

PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore

The Use of Service Oriented Architecture In Tax and Revenue

Lesson 4 Web Service Interface Definition (Part I)

Reusing Existing * Java EE Applications from Oracle SOA Suite

Enterprise IT Architectures SOA Part 2

Web-Based Hazus-MH. A Conceptual Approach. Mourad Bouhafs, AVP ATKINS Atlanta mourad.bouhafs@atkinsglobal.com

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

Service Component Architecture for Building Cloud Services

Building the European Biodiversity. Observation Network (EU BON)

Service Oriented Architectures

Microsoft SOA Roadmap

E-Business Suite Oracle SOA Suite Integration Options

Definition of SOA. Capgemini University Technology Services School Capgemini - All rights reserved November 2006 SOA for Software Architects/ 2

Service-Oriented Architecture: Analysis, the Keys to Success!

Simplifying Processes Interoperability with a Service Oriented Architecture

Selenium WebDriver. Gianluca Carbone. Selenium WebDriver 1

SOA Myth or Reality??

Service Virtualization: Managing Change in a Service-Oriented Architecture

A Comparison of SOA Methodologies Analysis & Design Phases

Myths About Service-Oriented Architecture Demystifying SOA. producers can coexist, and still have no dependence on each other.

Prerequisites for Successful SOA Adoption

SOA, BPM, and Microsoft: A Pragmatic View

Sadržaj seminara: SOA Architecture. - SOA Business Challenges s: Billion Dollar Lock-In. - Integration Tools. - Point-to-Point Approach

Spring 2011 Conference Sandanski, May 13th 15th 2011 Oracle SOA Suite 11g Rapid service integration and process automation with a no-coding approach

EAI OVERVIEW OF ENTERPRISE APPLICATION INTEGRATION CONCEPTS AND ARCHITECTURES. Enterprise Application Integration. Peter R. Egli INDIGOO.

A Unified Messaging-Based Architectural Pattern for Building Scalable Enterprise Service Bus

SOA Fundamentals For Java Developers. Alexander Ulanov, System Architect Odessa, 30 September 2008

The Challenges in Real Life ESB Deployments

Advanced Analysis and Design

Automating Rich Internet Application Development for Enterprise Web 2.0 and SOA

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

September 2009 Cloud Storage for Cloud Computing

SOA Planning Guide The Value Enablement Group, LLC. All rights reserved.

CcMS: A Cloud Computing Based Content Management System

SOA : To Do or Not to Do

Service Oriented Architecture Case: IBM SOA Reference Architecture

Tomáš Müller IT Architekt 21/04/2010 ČVUT FEL: SOA & Enterprise Service Bus IBM Corporation

Alternatives to SNMP and Challenges in Management Protocols. Communication Systems Seminar Talk 10 Francesco Luminati

Setting the World on FHIR

Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture

Reengineering Open Source CMS using Service-Orientation: The Case of Joomla

Web Services and Service Oriented Architectures. Thomas Soddemann, RZG

SOA and Cloud in practice - An Example Case Study

ITU-T Kaleidoscope Conference Innovations in NGN. Managing NGN using the SOA Philosophy. Y. Fun Hu University of Bradford

SOA CERTIFIED CONSULTANT

SOACertifiedProfessional.Braindumps.S90-03A.v by.JANET.100q. Exam Code: S90-03A. Exam Name: SOA Design & Architecture

1 What Are Web Services?

Federal Enterprise Architecture and Service-Oriented Architecture

Architecture. Reda Bendraou

Transcription:

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 hyperlinking 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: Clients interact with resources through a fix set of verbs. Example HTTP: (read), (create), PUT (update), 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 User Agent Origin Server HTTP User Agent Caching Origin Server Caching User Agent Caching 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 Clients Proxy/Gateway Origin Server 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 Clients Proxy/Gateway Origin Server 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 RESTful service Origin Servers 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 PUT C PUT PUT R S 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: Clients interact with resources through a fix set of verbs. Example HTTP: (read), (create), PUT (update), 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 Composite Representation C Link R PUT R PUT S Link S 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 RESTful service Origin Servers Client Origin Servers A composite representation can be produced by a composite service too 2009 - Cesare Pautasso 21

Doodle Map Example Composite Representation Composite RESTful service Origin Servers Client Origin Servers Vote on a meeting place based on its geographic location 2009 - Cesare Pautasso 22

1. Composite Resource PUT C PUT PUT R S 2009 - Cesare Pautasso 23

1. Composite Resource C PUT R S 2009 - Cesare Pautasso 24

2. Composite Representation DM G Link G Link C C PUT Link D R S 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 PUT C PUT PUT R S 2009 - Cesare Pautasso 28

Simply aggregating data (feeds) Read-only vs. Read/write C R S 2009 - Cesare Pautasso 29

Is your composition reusable? UI vs. API Composition Client Composite Representation UI Origin Servers Composite RESTful service API Origin Servers Reusable services vs. Reusable Widgets 2009 - Cesare Pautasso 30

Single-Origin Sandbox Can you always do this from a web browser? Composite Representation Composite RESTful service Origin Servers 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 RESTful service N Origin Servers Client 1 Origin Server 2009 - Cesare Pautasso 32

Complementary Read-Only Read/Write UI Mashup REST API Composition Situational Sandboxed Reusable Service 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 the service model defined by WSDL 1.1. [ ] Both the process and its partners are exposed as WSDL services WS-BPEL 2.0 WSDL 1.1 [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... <Invoke Op_1> <Invoke Op_2> WSDL 2.0 Operations Op_1 Op_2 Op_3 Op_4 PUT R... <Invoke Op_3> <Invoke Op_4>... HTTP Binding Op URI Method Op_1 R PUT Op_2 R Op_3 R Op_4 R 2009 - Cesare Pautasso 37

BPM Workflow Languages RESTful Web Service Composition 2009 - Cesare Pautasso 38

Solutions 1. Abstract Workflow Service invocation technology does not matter 2. Concrete Workflow Expose service invocation technologies as explicit constructs in the workflow language 3. RESTful Workflow Workflow as one kind of resource exposed by a RESTful service BPM Workflow Languages RESTful Web Service Composition BPM RESTful Workflow Web Service LanguagesComposition BPM RESTful Workflow Web Service Languages Composition 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... <Invoke Op_1> <Invoke Op_2> WSDL 2.0 Operations Op_1 Op_2 Op_3 Op_4 PUT R... <Invoke Op_3> <Invoke Op_4>... HTTP Binding Op URI Method Op_1 R PUT Op_2 R Op_3 R Op_4 R 2009 - Cesare Pautasso 40

BPEL for REST Make REST interaction primitives first-class language constructs BPEL for REST... <Put R> <Get R>... <Post R> <Delete R>... PUT R 2009 - Cesare Pautasso 41

BPEL for REST Dynamically publish resources from BPEL processes and handle client requests PUT P BPEL for REST PUT <Resource P> <onget> <Put R> <Get S> </onget> <ondelete> <Post R> <Delete S> </ondelete> </Resource> 2009 - Cesare Pautasso 42 R PUT S

RESTful Workflows PUT P R 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 Networkbased 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 7 th 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