REST på Microsoft-stacken

Slides:



Advertisements
Similar presentations
REST - Representational State Transfer
Advertisements

REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Introduction to Web Services
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.
General introduction to Web services and an implementation example
Building RESTful Interfaces
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.
Introduction to Web Interface Technology (CSE2030)
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Client/Server Architectures
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
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,
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
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.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Pete Brown Developer Community Program Manager, Microsoft REST with Silverlight 5, WCF.
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.
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.
Keith Telle Lead Software Engineer Bit Wizards REST, WebAPI 2, and Best Practices.
WebApi: What is it? How can I use it? Guy In Front of the Whittaker.
The best of WF 4.0 and AppFabric Damir Dobric MVP-Connected System Developer Microsoft Connected System Division Advisor Visual Studio Inner Circle member.
Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –
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.
Mary Ganesan and Lora Strother Campus Tours Using a Mobile Device.
National College of Science & Information Technology.
Jason Bury Dylan Drake Rush Corey Watt
The Client-Server Model
API (Application Program Interface)
Thoughts on Architecture for the Internet of Things
RESTful Sevices Distributed Objects Presented by: Shivank Malik
OpenInsight as a REST API Engine
WEB SERVICES.
REST: Web Services Abel Sanchez.
REST- Representational State Transfer Enn Õunapuu
Unit – 5 JAVA Web Services
Advanced Web-based Systems | Misbhauddin
Processes The most important processes used in Web-based systems and their internal organization.
Representational State Transfer
WEB API.
Ashish Pandit, Louis Zelus, Jonathan Whitman
Lecture 1: Multi-tier Architecture Overview
$, $$, $$$ API testing Edition
Saranya Sriram Developer Evangelist | Microsoft
Service-Oriented Computing: Semantics, Processes, Agents
A gentle introduction to RESTful APIs
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
REST APIs Maxwell Furman Department of MIS Fox School of Business
RESTful Web Services.
Service-Oriented Computing: Semantics, Processes, Agents
A gentle introduction to RESTful APIs
Chengyu Sun California State University, Los Angeles
REST API Design Borrowed heavily from:
Presentation transcript:

REST på Microsoft-stacken Robert Folkesson Active Solution

Who AM I?

REST? Dissertation by Roy Fielding 2000 “Architectural Styles and the Design of Network-based Software Architectures” ReST = Representational State Transfer

Architectural constraints Client–server Stateless Cacheable Layered system Uniform Interface Client–server A uniform interface separates clients from servers. This separation of concerns means that, for example, clients are not concerned with data storage, which remains internal to each server, so that the portability of client code is improved. Servers are not concerned with the user interface or user state, so that servers can be simpler and more scalable. Servers and clients may also be replaced and developed independently, as long as the interface between them is not altered. Stateless The client–server communication is further constrained by no client context being stored on the server between requests. Each request from any client contains all of the information necessary to service the request, and any session state is held in the client. The server can be stateful; this constraint merely requires that server-side state be addressable by URL as a resource. This not only makes servers more visible for monitoring, but also makes them more reliable in the face of partial network failures as well as further enhancing their scalability. Cacheable As on the World Wide Web, clients can cache responses. Responses must therefore, implicitly or explicitly, define themselves as cacheable, or not, to prevent clients reusing stale or inappropriate data in response to further requests. Well-managed caching partially or completely eliminates some client–server interactions, further improving scalability and performance. Layered system A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way. Intermediary servers may improve system scalability by enabling load-balancing and by providing shared caches. They may also enforce security policies. Code on demand (optional) Servers are able temporarily to extend or customize the functionality of a client by the transfer of executable code. Examples of this may include compiled components such as Java applets and client-side scripts such as JavaScript. Uniform interface The uniform interface between clients and servers, discussed below, simplifies and decouples the architecture, which enables each part to evolve independently. The four guiding principles of this interface are detailed below.

Scalability GET http://fabrikam.com/API/User/42

Guiding principles of REST-interfaces Identification of resources Manipulation of resources through representations of these resources Self-descriptive messages Hypermedia as the engine of application state Client–server A uniform interface separates clients from servers. This separation of concerns means that, for example, clients are not concerned with data storage, which remains internal to each server, so that the portability of client code is improved. Servers are not concerned with the user interface or user state, so that servers can be simpler and more scalable. Servers and clients may also be replaced and developed independently, as long as the interface between them is not altered. Stateless The client–server communication is further constrained by no client context being stored on the server between requests. Each request from any client contains all of the information necessary to service the request, and any session state is held in the client. The server can be stateful; this constraint merely requires that server-side state be addressable by URL as a resource. This not only makes servers more visible for monitoring, but also makes them more reliable in the face of partial network failures as well as further enhancing their scalability. Cacheable As on the World Wide Web, clients can cache responses. Responses must therefore, implicitly or explicitly, define themselves as cacheable, or not, to prevent clients reusing stale or inappropriate data in response to further requests. Well-managed caching partially or completely eliminates some client–server interactions, further improving scalability and performance. Layered system A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way. Intermediary servers may improve system scalability by enabling load-balancing and by providing shared caches. They may also enforce security policies. Code on demand (optional) Servers are able temporarily to extend or customize the functionality of a client by the transfer of executable code. Examples of this may include compiled components such as Java applets and client-side scripts such as JavaScript. Uniform interface The uniform interface between clients and servers, discussed below, simplifies and decouples the architecture, which enables each part to evolve independently. The four guiding principles of this interface are detailed below.

HATEOAS Hypermedia as the engine of application state

Example of hypermedia representation (Netflix)

Richardsons maturity model Glory of REST Level 3: Hypermedia Controls Level 2: HTPP Verbs Level 1: Resources developed by Leonard Richardson Level 0: The swamp of POX

REST on Microsoft – some history WCF pre-3.5: painful… WCF 3.5: WebHttpBinding. WCF REST Starter Kit (no longer supported) WCF Data Services (OData) WCF Web API - Preview 1 - 6

WCF ASP.NET Web API

http://www.asp.net/web-api Goal: One HTTP/ REST / Hypermedia API Fx Integrated in ASP.NET: Best of both world

WCF to ASP.NET Web API WCF Web API ASP.NET Web API Service => Web API controller Operation => Action Service contract => n/a Endpoint => n/a URI templates => ASP.NET Routing Message handlers => Same Formatters => Same Operation handlers => Filters, model binders

DEMO – File new Not a whole lot

Media types & Media Formatters

Media types & Media Formatters Built in support for: XML JSON form-urlencoded data Can be extended with custom Media Formatters

DEMO – Media Type formatter

Web API on NuGet Web API hosted in ASP.NET: Self-hosted Web API: AspNetWebApi Self-hosted Web API: AspNetWebApi.Selfhost HttpClient including XML and JSON formatters: System.Net.Http.Formatting JsonValue for navigating and manipulating JSON: System.Json

Node-style Web API? http://blogs.msdn.com/b/youssefm/archive/2012/02/24/ writing-a-lightweight-web-service-using-webapi-building-blocks.aspx

DEMO – SELF HOSTING

Web API can be used for all levels Glory of REST Level 3: Hypermedia Controls Level 2: HTPP Verbs ASP.NET Web API Level 1: Resources Level 0: The swamp of POX

Some good reading

Nextperience for a connected world with ASP.NET Web API The theme of TechDays 2012 is The nextperience which means that we link together the next experience with existing experience. We want you to write down your one-liner and shortly describe What's your nextperience.

Thank you! Robert Folkesson | Active Solution robert.folkesson@activesolution.se | @rfolkes www.robertfolkesson.se

Please use this slide as your last.