Advanced Web-based Systems | Misbhauddin

Slides:



Advertisements
Similar presentations
REST Vs. SOAP.
Advertisements

REST Introduction 吴海生 博克软件(杭州)有限公司.
Introduction to Web Services
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Definitions, Definitions, Definitions Lead to Understanding.
COMPUTER TERMS PART 1. COOKIE A cookie is a small amount of data generated by a website and saved by your web browser. Its purpose is to remember information.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Web Services XML-RPC, SOAP, REST Advanced Web-based Systems | Misbhauddin.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
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.
API Crash Course CWU Startup Club. OUTLINE What is an API? Why are API’s useful? What is HTTP? JSON? XML? What is a RESTful API? How do we consume an.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
Web Technologies Lecture 1 The Internet and HTTP.
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.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Representational State Transfer COMP6017 Topics on Web Services 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 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.
National College of Science & Information Technology.
Java Web Services Orca Knowledge Center – Web Service key concepts.
Web fundamentals: Clients, Servers, and Communication
Thoughts on Architecture for the Internet of Things
RESTful Sevices Distributed Objects Presented by: Shivank Malik
HTTP – An overview.
Better RESTFul API – Best Practices
Web Development Web Servers.
HTTP request message: general format
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Introduction to: The Architecture of the World Wide Web
WEB SERVICES.
REST- Representational State Transfer Enn Õunapuu
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Node.js Express Web Services
Unit – 5 JAVA Web Services
Hypertext Transfer Protocol
Hypertext Transport Protocol
Web Caching? Web Caching:.
Processes The most important processes used in Web-based systems and their internal organization.
Representational State Transfer
Ashish Pandit IT Architect, Middleware & Integration Services
Introduction to: The Architecture of the World Wide Web
WEB API.
Chapter 27 WWW and HTTP.
Lecture 1: Multi-tier Architecture Overview
Introduction to: The Architecture of the World Wide Web
$, $$, $$$ API testing Edition
HyperText Transfer Protocol
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
A gentle introduction to RESTful APIs
EE 122: HyperText Transfer Protocol (HTTP)
REST APIs Maxwell Furman Department of MIS Fox School of Business
RESTful Web Services.
REST på Microsoft-stacken
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
WEB SERVICES From Chapter 19, Distributed Systems
Week 05 Node.js Week 05
A gentle introduction to RESTful APIs
Chengyu Sun California State University, Los Angeles
REST API Design Borrowed heavily from:
Presentation transcript:

Advanced Web-based Systems | Misbhauddin Web Services REST Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Web Services Web services are web application components that provide an interface to the applications and not users Approaches XML-RPC SOAP REST Client / Server Web Services Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Web Scalability Issue The WorldWideWeb (W3) is a wide-area hypermedia information retrieval initiative aiming to give universal access to a large universe of documents. - Tim Berners-Lee The above was said about the web in 1991 Web began to grow exponentially since then The “Universe of Documents” was expanding The Web was growing too large, too fast, and it was heading toward collapse It was unclear if the Web would scale to meet the increasing demand Advanced Web-based Systems | Misbhauddin

Web Scalability - Solution Roy Fielding got concerned by the Web Scalability Problem Web’s scalability was governed by a set of key constraints Uniformly satisfy all of the constraints - so that the Web could continue to expand Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Constraints The six constraints are: Client-Server Uniform Interface Layered System Cacheable Stateless Code on Demand (optional) Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Client-Server Web is a client-server based system Clients and Servers have distinct parts to play They may be implemented and deployed independently using any language or technology Assume a disconnected system Separation of Concern But they should conform to Uniform Interface Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Uniform Interface There is interaction between web components Clients, Servers, Intermediaries Depends on a uniform interface between them If any of them move away from standards Web Communication breaks down Four sub-constraints - Simplifies and decouples the architecture Identification of resources; Manipulation of resources through representations; Self-descriptive messages; HATEOAS Advanced Web-based Systems | Misbhauddin

Identification | Uniform Interface Identification of Resources Each web-based concept is known as a resource It is addressed by a unique identifier – URI Advanced Web-based Systems | Misbhauddin

Manipulation | Uniform Interface Manipulation of Resources through Representations Clients manipulate representation of resources Same resource is represented in different way to different clients A file can be sent as a HTML to a web browser and as a JSON to an application Resources can be manipulated through representations without changing the actual resource Advanced Web-based Systems | Misbhauddin

Self-Descriptive | Uniform Interface Self-Descriptive Messages Desired representation (or state) can be mentioned in the request message Current state is mentioned in the response message The resource state is included as a self-descriptive message Advanced Web-based Systems | Misbhauddin

HATEOAS | Uniform Interface Hypermedia As The Engine Of Application State A resource’s state includes link to other resources The presence or absence of a link is a part of the resource’s current state Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Layered System Client cannot assume direct connection to the server Software or hardware intermediaries between the server and the client – Gateways and Proxies Also called network based intermediaries Improves scalability Network-based intermediaries are commonly used for Enforcement of security Response caching Load balancing Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Cacheable| REST Caching is one of web architecture’s most important constraints Caching response data can help Reduce client-perceived latency Increase the overall availability and reliability of an application Control a web server’s load In other words, caching reduces the cost of the web Cache can exist in any place in the path between the client and the server Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Stateless| REST Web Server does not remember the state of its client applications Each request contains enough context to process the message Self-descriptive messages; Any session state is kept on the client Client manage the state – Server can service much larger clients Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Code on Demand| REST Server can temporarily transfer executable code (scripts and plug-ins) to the client Transfer logic to client - Client executes logic Client must be able to understand and execute the code that it demands from the server This is why it is Optional For example JavaScript Java Applets Flash Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin REST Representation State Transfer Set of architectural principles – data transmitted over HTTP Focus on design rules for stateless service Each resource is represented using a unique URI Representation of the resource is returned With each representation, client can transfer state All-in-all, it is an architectural style composed of all the six constraints Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin RESTful Web Services Request Client Web API Web Service Backend Response Web API is the face of the Web Service REST style is applied to the design of the API The API is called REST API and the service becomes RESTful The REST API consists of interlinked resources The set of resources is known as the resource model Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin URIs REST APIs use Uniform Resource Identifiers (URIs) to address resources Identify the things that you want to operate on – meaning RESOURCES A web page is a type of resource /professors List of all professors at CCSIT /professors/Misbhauddin Identify professor named ‘Misbhauddin’ GET /professors/Misbhauddin HTTP/1.1 Host: kfu.edu.sa/ccsit Resources are best thought of as nouns Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Resource Archetypes Document: A document resource is a singular concept similar to a database record. A document may have child resources that represent its specific subordinate concepts. http://api.soccer.restapi.org/leagues/seattle http://api.soccer.restapi.org/leagues/seattle/teams/trebuchet http://api.soccer.restapi.org/leagues/seattle/teams/trebuchet/players/mike http://api.soccer.restapi.org docroot Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Resource Archetypes Collection: A collection resource is a server-managed directory of resources. Clients may propose new resources to be added to a collection http://api.soccer.restapi.org/leagues http://api.soccer.restapi.org/leagues/seattle/teams http://api.soccer.restapi.org/leagues/seattle/teams/trebuchet/players Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Resource Archetypes Store: A store is a client-managed resource repository. A store resource lets an API client put resources in, get them back out, and decide when to delete them. The example interaction above shows a user (with ID 1234) of a client program using a REST API to insert a document resource named brazil in his store of favorites PUT /users/1234/favorites/brazil Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Resource Archetypes Controller: Controller resources are like executable functions, with parameters and return values; inputs and outputs. Controller names typically appear as the last segment in a URI path, with no child resources POST /alerts/245743/resend POST /alerts/245743/resend/resource Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin URI Design Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Interactions Used to manipulate a resource’s representation Lets say we want to add a new professor Two ways OR …… Use a specific URL Use HTTP Verbs /professors/add Not RESTful GET /professors/Misbhauddin HTTP/1.1 Host: kfu.edu.sa/ccsit Advanced Web-based Systems | Misbhauddin

HTTP Verbs | Request Actions HTTP verbs tell the server what to do with the data identified by the URL. GET used to get the representation of the resourse PUT used insert or update a resource DELETE used to delete a resource from the parent POST used to create a new resource in the collection or execute controller HEAD used to get the Headers of the response only OPTIONS used to get info about resource’s available interactions Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Request Message > GET /greeting HTTP/1.1 > User-Agent: chrome /7.20.1 > Host: api.example.restapi.org > Accept: */* < HTTP/1.1 200 OK < Date: Sat, 20 Aug 2011 16:02:40 GMT < Server: Apache < Expires: Sat, 20 Aug 2011 16:03:40 GMT < Cache-Control: max-age=60, must-revalidate < ETag: text/html:hello world < Content-Length: 130 < Last-Modified: Sat, 20 Aug 2011 16:02:17 GMT < Vary: Accept-Encoding < Content-Type: text/html <!doctype html><head><meta charset="utf-8"><title>Greeting</title></head> <body><div id="greeting">Hello World!</div></body></html> Request Headers Response Message – Status Line Response Headers Example Response Body Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Representations The HTTP client and HTTP server exchange information about resources identified by URIs Typically resource is represented using JSON or XML Example Resource: person (Mohammed) Service: contact information (GET) Representation: Name, address, phone number JSON or XML format or VCard Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin SOAP vs. REST SOAP REST Language, platform, and transport independent (REST requires use of HTTP) Works well in distributed enterprise environments (REST assumes direct point-to-point communication) Standardized Provides significant pre-build extensibility in the form of the WS* standards Built-in error handling Automation when used with certain language products No expensive tools require to interact with the Web service Smaller learning curve Efficient (SOAP uses XML for all messages, REST can use smaller message formats) Fast (no extensive processing required) Closer to other Web technologies in design philosophy Advanced Web-based Systems | Misbhauddin

Advanced Web-based Systems | Misbhauddin Recommended Reading For the REST architecture REST API Design Rulebook by Mark Masse Publisher: O'Reilly Media, Inc. Release Date: October 2011 Chapters 1, 2, and 3 Advanced Web-based Systems | Misbhauddin