Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins – 2012-2013.

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights
Representational State Transfer (REST) Paul Townend 8 th February 2007.
REST - Representational State Transfer
REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Introduction to Web Services
Server Access The REST of the Story David Cleary
REST (Representational State Transfer)
GET. Introduction, overview Best practices Roy T Fielding, PhD dissertation, 2000 Main characteristics Client-server Stateless Caching Layered architecture.
WHO AM I? REST? Dissertation by Roy Fielding 2000 Architectural Styles and the Design of Network-based Software Architectures ReST = Representational.
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Building RESTful Interfaces
Web Services Seminar: Service Description Languages
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
Thoughts on Architecture for the Internet of Things Group Name: Working Group 2 - Architecture Source: Nicolas Damour, Sierra Wireless
Chapter 3: Programming Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
Distributed components
.NET Mobile Application Development Introduction to Mobile and Distributed Applications.
Controling instrument in the RESTful way
Jon Flanders INT303. About Me  Jon Flanders –  Independent consultant/trainer  BizTalk MVP.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Service YU-RONG CHEN June 5 th Outline Web Service – SOAP – WSDL – UDDI – Implementation RESTful Web Service – REST – Example – Implementation.
Web Architecture & Services (2) Representational State Transfer (REST)
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Prepared By : Monika Darji Web Services using REST & JAX-WS.
RESTful applications Norman White. REST Representational state transfer Key concepts – Client Server architecture built on transferring resources between.
Web Services XML-RPC, SOAP, REST Advanced Web-based Systems | Misbhauddin.
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
1 Seminar on Service Oriented Architecture Principles of REST.
Web Architecture update for WSAWG/WSDL TAG published Principles of the Web Contents: –Identifiers Most of the work –Formats Not much –Protocols Summary.
Advanced Web Technologies Lecture #4 By: Faraz Ahmed.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
RESTful Web Services What is RESTful?
REST By: Vishwanath Vineet.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
06 March 2007COMS E61251 COMS E6125 Web-enHanced Information Management (WHIM) Prof. Gail Kaiser Spring 2007.
Keith Telle Lead Software Engineer Bit Wizards REST, WebAPI 2, and Best Practices.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
Linked Data Publishing on the Semantic Web Dr Nicholas Gibbins
Using Retrofit framework in implementation of Android REST client David Ante Macan*, Zlatko Stapić, Milan Pavlović* University of Zagreb Faculty of Organization.
REST REPRESENTATIONAL STATE TRANSFER Scott Ainsworth & Louis Nguyen (Group 1) Old Dominion University, CS 791: Web Syndication Formats, January 29, 2008.
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
Intro to REST Joe Gregorio Google. REST is an Architectural Style.
REST in Practice COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Thoughts on Architecture for the Internet of Things
RESTful Sevices Distributed Objects Presented by: Shivank Malik
OpenInsight as a REST API Engine
Lecture 92 Test 1 – Take Home Post mortem
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
REST- Representational State Transfer Enn Õunapuu
Advanced Web-based Systems | Misbhauddin
Representational State Transfer
Ashish Pandit IT Architect, Middleware & Integration Services
WEB API.
Ashish Pandit, Louis Zelus, Jonathan Whitman
COMP3220 Web Infrastructure COMP6218 Web Architecture
Service-Oriented Computing: Semantics, Processes, Agents
A gentle introduction to RESTful APIs
REST APIs Maxwell Furman Department of MIS Fox School of Business
RESTful Web Services.
REST på Microsoft-stacken
WEB SERVICES From Chapter 19, Distributed Systems
Service-Oriented Computing: Semantics, Processes, Agents
A gentle introduction to RESTful APIs
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –

Resource Oriented Model 2

Representational State Transfer Original design for the Web did not have a formal architecture –Network issues with early HTTP affected scalability –Nature of application interactions on the Web changed (images, etc) –Limited support for shared caching Architectural style that parallels and informs the design of HTTP/1.1 –Described in a thesis by Roy Fielding (Day Software, co-founder of the Apache Software Foundation, co-author of HTTP and URI RFCs)

REST Constraints 4

Constraints Fielding identifies five key constraints (and one optional constraint) for REST: –Client-Server –Stateless –Cacheable –Layered system –Uniform interface –Code on demand

Client-Server Separation of concerns: –user interface (client) –data storage (server) +Improves portability of user interface +Improves scalability by simplifying server +Allows components to evolve separately

Stateless 7 Each request from client to server must contain all of the information necessary to understand the request –No context is stored on the server –Session state is kept entirely on the client +Improves visibility (can consider each request in isolation) +Improves reliability (easier to recover from partial failures) +Improves scalability (reduces server resource usage) -Increases per-interaction overhead

Cache 8 Response data must be labelled as cacheable or non-cacheable –If cacheable, client may reuse response data for later requests +Allows some interactions to be eliminated +Reduces average latency of interactions -Stale data reduces reliability

Uniform Interface 9 Uniform interface between components –Identification of resources –Manipulation of resources through representations –Self-descriptive messages –Hypermedia as the engine of application state +Improves visibility of interactions +Encourages independent evolvability -Degrades efficiency (depending on optimisation)

Layered System 10 System components have no knowledge of components beyond those with which they directly interact –Encapsulate legacy services –Introduce intermediaries +Limits system complexity +Improves scalability (load balancing) -Adds latency and overhead (offset by caching)

Code on Demand (optional) 11 Client functionality extended by downloading and executing code –Applets –Scripts +Improves extensibility -Reduces visibility

Architectural Elements 12

Data Elements Resources Resource identifiers Representations Representation metadata Control data

Connectors 14 Client Server Cache Resolver Tunnel

Components 15 Origin server Gateway Proxy User agent

Further Reading 16 Architectural Styles and the Design of Network-based Software Architectures (Ch 4-6)

Introduction to RESTful Web Services 17

REST beyond the Web architecture Discussion of Web Services has concentrated on W3C Web Services Architecture (+WS-I, etc) Discussion of REST has concentrated on the W3C Web Architecture We can apply the constraints from REST to the design of Web Services –Better fit between the two architectures

Model of RESTful maturity REST constraints made concrete, in context of Web technology stack HypermediaHTTPURI The Richardson Maturity Model 19

Single well-known endpoint Uses HTTP as a transport only No hypermedia HypermediaHTTPURI Level Zero 20

Level Zero in Practice 21 XML-RPC Most SOAP services POX

POX: Plain Old XML over HTTP 22 Use HTTP POST to transfer XML documents between systems –SOAP-like, without SOAP headers, etc –Platform independent Uses HTTP as a transport protocol, not an application protocol –HTTP metadata is ignored

Multiple endpoints Uses HTTP as a transport only (single verb) No hypermedia HypermediaHTTPURI Level One 23

Templates and Tunnelling 24 URI templates – URI tunneling –Use GET for safe/idempotent operations –Use POST otherwise –Map existing method parameters to URI query parameters –

URI Tunnelling 25 Sometimes Web-friendly –Multiple URIs used to name resources –(Sometimes) correct use of GET but –URIs used to encode operations, rather than identify resources –Use of GET for non-safe operations breaches Web Architecture principle of Safe Retrieval

Multiple endpoints, identifying resources Understands HTTP (multiple verbs) No hypermedia HypermediaHTTPURI Level Two 26

Mapping CRUD to HTTP 27 OperationHTTP Verb CreatePOST to a URI, creates new subordinate resource ReadGET, returns representation UpdatePUT, providing new representation DeleteDELETE, removes resource

Multiple endpoints, identifying resources Understands HTTP (multiple verbs) Uses links to communicate protocols (shared state) HypermediaHTTPURI Level Three 28

HATEOAS 29 Hypermedia as the engine of application state Resource representations include links to related resources –Links that represent a transition to a possible future state of the current resource –Link types used to indicate operations (HTTP verbs) that may be used on the indicated resources –State transitions constitute application protocol

Next Lecture 30 REST in Practice!

Running Example: Restbucks 31 Online coffee shop –Customer (client) orders coffee from barista order submitted payment received canceled in preparation order completed customise cancel pay add to queue check status deliver