REST web services. Representational State Transfer Author: Nemanja Kojic

Similar documents
REST vs. SOAP: Making the Right Architectural Decision

Security Testing For RESTful Applications

Mobility Information Series

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

Core Feature Comparison between. XML / SOA Gateways. and. Web Application Firewalls. Jason Macy jmacy@forumsys.com CTO, Forum Systems

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

Introduction into Web Services (WS)

XML Processing and Web Services. Chapter 17

Designing RESTful Web Applications

WEB SERVICES TEST AUTOMATION

The presentation explains how to create and access the web services using the user interface. WebServices.ppt. Page 1 of 14

Enabling REST Services with SAP PI. Michael Le Peter Ha

Service Oriented Architecture: Web GIS Services

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Lesson 4 Web Service Interface Definition (Part I)

Repeater. BrowserStack Local. browserstack.com 1. BrowserStack Local makes a REST call using the user s access key to browserstack.

Web Services Technologies: State of the Art

WEB SERVICES. Revised 9/29/2015

Distribution and Integration Technologies

02267: Software Development of Web Services

Integrating Complementary Tools with PopMedNet TM

Domain Name System (DNS)

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

A Model of the Operation of The Model-View- Controller Pattern in a Rails-Based Web Server

Types of Cloud Computing

Beyond The Web Drupal Meets The Desktop (And Mobile) Justin Miller Code Sorcery Workshop, LLC

Computer Networks. Lecture 7: Application layer: FTP and HTTP. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

Enhanced Mobile Cloud Computing Platform

Java Web Services Training

How To Write A Web Server In Javascript

Fairsail REST API: Guide for Developers

Literature Review Service Frameworks and Architectural Design Patterns in Web Development

JVA-561. Developing SOAP Web Services in Java

JAVA API FOR XML WEB SERVICES (JAX-WS)

Leveraging Cloud Storage Through Mobile Applications Using Mezeo Cloud Storage Platform REST API. John Eastman Mezeo

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Load Testing RIA using WebLOAD. Amir Shoval, VP Product Management

Service Computing: Basics Monica Scannapieco

Middleware and the Internet

ITP 140 Mobile Technologies. Mobile Topics

Progress OpenEdge REST

IBM SPSS Collaboration and Deployment Services Version 6 Release 0. Single Sign-On Services Developer's Guide

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

WEB SERVICES FOR MOBILE COMPUTING

Table of Contents. Open-Xchange Authentication & Session Handling. 1.Introduction...3

REST API Development. B. Mason Netapp E-Series

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into

4. Concepts and Technologies for B2C, B2E, and B2B Transaction

Smartphone Enterprise Application Integration

HTTP. Internet Engineering. Fall Bahador Bakhshi CE & IT Department, Amirkabir University of Technology

Modern Web Development From Angle Brackets to Web Sockets

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR DEPARTMENT OF COMPUTER APPLICATIONS SUBJECT : MC7502 SERVICE ORIENTED ARCHITECTURE

Big Data Analytics in LinkedIn. Danielle Aring & William Merritt

ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:

A Tool for Evaluation and Optimization of Web Application Performance

Developing Java Web Services

SOA and Virtualization Technologies (ENCS 691K Chapter 2)

XIII. Service Oriented Computing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

From RPC to Web Apps: Trends in Client-Server Systems

Setting the World on FHIR

Internet of Things (IoT): Middleware. Roch Glitho, PhD Associate Professor and Canada Research Chair My URL -

Integration the Web 2.0 way. Florian Daniel April 28, 2009

Strategic Information Security. Attacking and Defending Web Services

Consuming and Producing Web Services with WST and JST. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Service Oriented Architecture

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

4D Deployment Options for Wide Area Networks

Invocación remota (based on M. L. Liu Distributed Computing -- Concepts and Application

Guidelines for Implementation of REST

70-487: Developing Windows Azure and Web Services

What is a Web service?

Owner of the content within this article is Written by Marc Grote

PARTNER INTEGRATION GUIDE. Edition 1.0

02267: Software Development of Web Services

Information Supplement: Requirement 6.6 Code Reviews and Application Firewalls Clarified

Performance Testing for Ajax Applications

Web Services Implementation: The Beta Phase of EPA Network Nodes

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

ANDROID APPS DEVELOPMENT FOR MOBILE GAME

SaaS-Based Employee Benefits Enrollment System

Grid Computing. Web Services. Explanation (2) Explanation. Grid Computing Fall 2006 Paul A. Farrell 9/12/2006

e-gov Architecture Service Interface Guidelines

Rich-Internet Anwendungen auf Basis von ColdFusion und Ajax

Barracuda Web Application Firewall vs. Intrusion Prevention Systems (IPS) Whitepaper

From the Intranet to Mobile. By Divya Mehra and Stian Thorgersen

Implementing Mobile Thin client Architecture For Enterprise Application

Load Balancing and Sessions. C. Kopparapu, Load Balancing Servers, Firewalls and Caches. Wiley, 2002.

Onegini Token server / Web API Platform

Cross-domain Identity Management System for Cloud Environment

Web Architecture I u

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

Transcription:

REST web services Representational State Transfer Author: Nemanja Kojic

What is REST? Representational State Transfer (ReST) Relies on stateless, client-server, cacheable communication protocol It is NOT a standard It is an architecture style for designing networked applications In almost all cases HTTP protocol is used (instead of complex CORBA, RPC or SOAP) HTTP can be viewed as REST-based architecture, as well HTTP used to post, read and delete data

What is REST? (cont.)

REST as Lightweight Web Services It is a programming approach REST is a lightweight alternative to complex mechanisms like: RPC (Remote Procedure Call) Web services (SOAP, WSDL, ) REST service is: Platform independent Langugage independent Standards based (runs on top of HTTP) Can easily be used in presence of firewalls.

REST as Lightweight Web Services REST offers no: Built-in security features Encryption Session management QoS quaranties Security features can be added easily: Security: user/pass tokens Encryption: HTTPS (secure sockets)

REST as Lightweight Web Services Cookies is not part of good REST design REST operations are self-contained Each request carries with it (Transfers) all the information (State) that the server needs to complete it

REST vs. SOAP request SOAP Request HTTP Post SOAP message must be assembled properly, and it is included as the HTTP payload. REST Request (URL) HTTP GET The result may be an XML content embodied inside a SOAP response envelope. HTTP reply is the raw result data, as-is. URL s method is called UserDetails, instead of GetUserDetails. It is a common convention in REST design to use nouns rather than verbs to denote simple resources.

REST vs. SOAP SOAP-based web Services are often implemented with libraries that maintain SOAP/HTTP requests Create and send the SOAP request Parse the SOAP response With REST, only a simple network connection is used Still there are some useful libraries that simplify the REST things.

More complex REST requests REST can easily handle more complex requests (including multiple parameters) For passing long parameters, or even binary ones, one can use HTTP POST requests

The REST rules GET requests for read-only queries (SHOULD NOT change the state) POST requests for Create/Update/Delete POST can also be used for read-only queries (large parameters)

REST and XML REST services may use XML in their responses REST requests rarely use XML request parameters are simple (no need for XML structuring) XML response SHOULD BE verified

REST Response Format JSON Example Response is often an XML file XML is easy to expand REST is not bound only to XML REST can also use other formats: CSV (Comma Separated Values) more compact JSON (JavaScript Object Notation) easily parseable by JavaScript clients HTML is not acceptable for REST responses! (except in rare cases, www)

REST Response Example

Real REST Examples The Google Glass API ( Mirror API ) Twitter REST API https://dev.twitter.com/docs/api Flickr, https://www.flickr.com/services/api/ Amazon, Simple Storage Service http://docs.aws.amazon.com/amazons3/2006-03- 01/API/APIRest.html Atom, restfull variant of RSS Tesla Model S (car systems Android/iOS apps), http://docs.timdorr.apiary.io/

AJAX and REST AJAX Asynchronous JAvaScript and XML AJAX makes web pages interactive using JS AJAX requests sent as XmlHttpRequest objects AJAX response is parsed by JS code AJAX follows the REST principles: XmlHttpRequest can be viewed as a GET request Response is often JSON (popular for REST)

REST Architecture Components Resources Identified by logical URLs Both state and functionality exposed as resources A web of resources Resources SHOULD NOT be too large and contain too fine-grained data Resources should exploit links to additional data Client-Server in a distributed fashion No connection state Stateless communication, although server and client can be stateful. Cacheable resources Protocol (HTTP) must allow caching of resources (with expiration) Proxy servers

REST Architecture

REST Design Guidlines Don t use physical URLs. NO: http://www.acme.com/p/product003.xml YES: http://www.acme.com/p/product/003 Queries should not return an overload data. Provide a paging mechanism with prev/next links Make sure the rest response format is well documented In case of XML, provide a schema or DTD

REST Design Guidlines Don t let clients construct REST URLs. Provide clients with complete URLs, instead. Include URL with each item. NO: http://www.acme.com/product/product_id YES: http://www.acme.com/product/001263 GET requests should never case a state change. Server state should be changed through POST requests

Documenting REST Services: WADL Web Application Description Language Created by Sun Microsystems WADL is lightweight Easy to understand and write It is not as flexible as WSDL WSDL can also be used for documenting REST services

WADL vs. WSDL Often used to describe SOAP-based services Flexible in service binding options It is possible to send SOAP messages via SMTP! It is more complex than WADL Supports all HTTP verbs It is acceptable for documenting REST services

WADL: An example The description of Amazon s ItemSeach service The Complete WADL spec. for Amazon s web service http://www.w3.org/submission/wadl/#x3-35000a.1

WADL: XML Header Section Namespace declarations. The XML validation schema.

Using REST in C# Issuing HTTP GET request Key classes: HttpWebRequest, HttpWebResponse URL parameters must be properly encoded (%20), use System.Web.HttpUtility.UrlEncode()

Using REST in C# (cont.) Issuing HTTP POST requests

References Learn Rest: A tutorial, http://rest.elkstein.org/