Building RESTful Interfaces

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
REST - Representational State Transfer
REST & SOAP Peter Drayton
REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Building and using REST information services Rion Dooley.
Introduction to Web Services
Distributed Information System December 7, 20091Alvin MACCHIONE - Rémy JAVELLE.
REST (Representational State Transfer)
Introduction to Web Services and Web API’s Richard Holowczak Baruch College December, 2014.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
Peoplesoft: Building and Consuming Web Services
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.
IT 210 The Internet & World Wide Web introduction.
Chapter 4: Core Web Technologies
Designing and Implementing Web Data Services in Perl
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,
Postacademic Interuniversity Course in Information Technology – Module C1p1 Contents Data Communications Applications –File & print serving –Mail –Domain.
Wyatt Pearsall November  HyperText Transfer Protocol.
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.
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.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
SNOWTAM Trial: REST Interface. AIXM XML Developers' Seminar 2 Contents Digital-SNOWTAM Trial Introduction REST Introduction REST in the Digital-SNOWTAM.
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.
S imple O bject A ccess P rotocol Karthikeyan Chandrasekaran & Nandakumar Padmanabhan.
2007cs Servers on the Web. The World-Wide Web 2007 cs CSS JS HTML Server Browser JS CSS HTML Transfer of resources using HTTP.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
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?
Web Services An Introduction Copyright © Curt Hill.
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.
Feeling RESTful? Well, first we’ll define a Web Service –A web page meant to be consumed by a computer via an autonomous program as opposed to a web browser.
Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
National College of Science & Information Technology.
The Client-Server Model
API (Application Program Interface)
Thoughts on Architecture for the Internet of Things
RESTful Sevices Distributed Objects Presented by: Shivank Malik
Better RESTFul API – Best Practices
Node.js Express Web Applications
Sabri Kızanlık Ural Emekçi
WEB SERVICES.
REST: Web Services Abel Sanchez.
REST- Representational State Transfer Enn Õunapuu
Node.js Express Web Services
Unit – 5 JAVA Web Services
Advanced Web-based Systems | Misbhauddin
Representational State Transfer
Ashish Pandit IT Architect, Middleware & Integration Services
Introduction to Web Services and SOA
WEB API.
Ashish Pandit, Louis Zelus, Jonathan Whitman
$, $$, $$$ API testing Edition
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
RESTful Web Services.
REST på Microsoft-stacken
Introduction to Web Services and SOA
Week 05 Node.js Week 05
Chengyu Sun California State University, Los Angeles
REST API Design Borrowed heavily from:
Presentation transcript:

Building RESTful Interfaces Steve Shaw

We will Cover What is REST? The precepts of a RESTful Interface Security Show how to implement a REST interface within the InterSystems Platform

What is REST Architectural style for web Applications introduced by Roy Fielding “Representational State Transfer is intended to evoke an image of how a well-designed web application behaves: a network of web pages (a virtual state- machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use.”

Or… "REST emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems. ” - Webopedia

Even Better… "Representational state transfer (REST) is a distributed system framework that uses Web protocols and technologies. The REST architecture involves client and server interactions built around the transfer of resources. The Web is the largest REST implementation - Techopedia

REST Rest is not a standard or protocol, REST is an architectural style. REST makes use of existing web standards such as HTTP, URL, XML, JSON, etc.. REST is resource oriented. Resources or pieces of information, are addressed by URIs and passed from server to client or vice versa

Principles of REST Uniform interface: simplifies and decouples the architecture, which enables each part to evolve independently. Stateless: no client context being stored on the server between requests. Each request all of the information necessary to service the request Cacheable: Well-managed caching partially or completely eliminates some client–server interactions, further improving scalability and performance.

RESTful Web Service A RESTful web service is a web API implemented using HTTP and the principles of REST. A collection of resources identified by a directory structure-like URI E.g.: https://www.googleapis.com/calendar/v3/calendars/joe.bloggs/events Operations based explicitly on HTTP methods (GET, POST, PUT, DELETE) Information transfer based on Internet media types, commonly JSON. Other types include XML,HTML, CSV (text)

CRUD operations REST operations fall under 4 types (CRUD) which are defined as http protocol methods: REST HTTP Create Post POST https://api.twitter.com/1.1/statuses/retweet/241259202004267009.json Read Get GET https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2 Update Put PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId Delete DELETE https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId

REST Advantages REST Simplicity (easy to use, maintain and test) Many options for representations(JSON, CSV, HTML, XML) Human Readable Results Performance Scalable architecture Lightweight requests and responses Easier response parsing Saves bandwidth(Caching, Conditional GET..) Well suited clients using JSON representations

REST Advantages Soap request REST request <?xml version=“1.0”?> <soap:Envelope xmlns:soap=http://www.w3.org/2001/12/soap-envelope soap:encodingStyle=http://www.w3.org/2001/12/soap-encoding> <soap:Body ord=“http://www.igroup.com/order”> <ord:GetOrderDetails> <ord:OrderNumber>12345</ord:OrderNumber> </ord:GetOrderDetails> </soap:Body> </soap:Envelope> REST request http://www.igroup.com/order?ordernum=12345

URL / URI REST interfaces are defined via a URL/URI URI – Uniform Resource Identifier Identifies a specific Resource on the network Example: http://www.igroup.com/order URL – Uniform Resource Locator Provides access to a specific representation of a resource on the network http://www.igroup.com/order?ordernum=12345 or http://www.igroup.com/order/ordernum/12345

Security Security is up to the Interface developer REST has no predefined methods for Security Security should take advantage of what is already available for Web Applications SSL/TLS (https:) OpenId Authorization (Oauth) Hash-based Message Authentication Code (HMAC)

Security REST is exposed to all the same vulnerabilities as an other Web based Applications Encrypt any sensitive payload or static keys Note HMAC does not encrypt data, a common miss- conception Sophisticated security models can be difficult to implement

Cache Implementation New class in 2014.1 - %CSP.REST In SMP register the Dispatch Class which matches your REST application base URL System>Security Management>Web Applications>Edit Web Application New web application /csp/samples/globalsummit Dispatch Class: Rest.Broker Use the UrlMap Xdata block to route requests to HTTP operation and target class method XData UrlMap { <Routes> <Route Url="/employee/html/list" Method="GET" Call="Rest.HTML:GetAllEmployees"/> </Routes>}

Example: Hello World Redux This service will provide access to a translation of “HELLO WORLD” into other languages. In this example we will: Configure the Web application Show the setup of a REST interface dispatch class Show the implementation options for the service resources (methods) Show the results

Q & A Any Questions?