SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
© 2012 MPS Partners.. All rights
reserved.
Why do you need REST
June 27, 2013
Brown Bag presentation by: Mayank Srivastava
www.MayankSrivastava.com
Agenda
o Understanding REST
o REST Vs. SOAP
o Web API Vs. WCF
o Web API features.
3
Interaction over HTTP
4
Interaction over HTTP
5
What is SOAP?
• An XML info set based on messaging protocol.
• SOAP messages have an envelope, headers and a body
• Transport neutral “interoperable” model.
• RPC based development approach.
6
What is REST
• REST = Representational State Transfer –
As introduced by Roy Fielding in 2000
• REST is the architectural style for the Web, to building services hosted and
consumed over HTTP.
Uniform interface, HTTP Data formats & Content types, client-server, stateless, cacheable, scalable.
General Use of terms:
RESTful Service
 HTTP Service
 No SOAP
WEB API == HTTP Service == RESTful Service.
7
REST Vs. SOAP
• SOAP focuses on verbs (methods) while REST focuses on noun (resource)
SOAP:
.GetProduct()
.UpdateLocations()
.DeleteUser()
REST: (Uniform Interface HTTP verbs)
Product { }
Location { }
User { }
With SOAP you define custom operation that tunnel thru POST
SOAP is a message protocol where REST is an architectural design for the web
8
Why REST?
• Do you need transport neutrality?
• Do you need WS* features?
• Benefits of already developed Web features like caching and scalability.
• Basic SOAP is just like REST but without the benefits.
• Fewer code transition layers
• It is the standard for communication in the “cloud”.
• Universal interface that everyone understands.
9
Why REST?
What about security?
All the your Web application supports
• Token based
• Active directory
• OAuth 2.0
Client Server
Resource request 
 Redirect to credential challenge
Credentials 
 Links and tokens to access resource & access token
10
Universal interface that everyone understands.
Your RESTful Service
11
Example SOAP message over HTTP
POST http://wcftest.azurewebsites.net/Service1.svc HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8; action="http://tempuri.org/IStockTicker/GetQuote"
Host: wcftest.azurewebsites.net
Content-Length: 168
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body>
<GetQuote xmlns="http://tempuri.org/">
<stockTicker>MSFT</stockTicker>
</GetQuote>
</s:Body>
</s:Envelope>
</s:Envelope>
______________________________________________________________________________________________________________________
HTTP/1.0 200 OK
Content-Length: 187
Content-Type: application/soap+xml; charset=utf-8
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body>
<GetQuoteResponse xmlns="http://tempuri.org/">
<GetQuoteResult>28.33</GetQuoteResult>
</GetQuoteResponse>
</s:Body>
</s:Envelope>
12
Example “RESTful” request/response
GET http://webapitest.azurewebsites.net/stocks?symbol=msft HTTP/1.1
Host: webapitest.azurewebsites.net
______________________________________________________________________________________________________________________
HTTP/1.0 200 OK
Content-Length: 5
Content-Type: application/json; charset=utf-8
33.12
13
Why SOAP
• SOAP interoperability is a requirement
• Non HTTP transports - TCP, UDP, Named Pipes, MSMQ, custom bindings
• WS-* based security.
14
Implementation Options
WCF
• WCF classic
• WCF Data Services
• WCF RIA Services
• WCF Web HTTP (aka WCF REST)
ASP.NET
• ASP.NET Web Services
• ASP.NET MVC
• ASP.NET Web API
• ASP.NET Web API OData
• ASP.NET SignalR
15
Recommendation:
WCF
• WCF classic
• WCF Data Services
• WCF RIA Services
• WCF Web HTTP (aka WCF REST)
ASP.NET
• ASP.NET Web Services
• ASP.NET MVC
• ASP.NET Web API
• ASP.NET Web API OData
• ASP.NET SignalR
For SOAP ------ WCF classic
For REST ------ ASP.NET WEB API
16
ASP.NET Web API (Code Demos)
• Simplicity
• Self Hosting
• Consuming from Server Side.
• Attribute routing - http://attributerouting.net/
• OData (emerging functionalities)
17
ASP.NET SignalR (Code Demos)
• Web socket based communication.
• Falls back to poll approach in the browser doesn’t support Web socket.
• http://signalr.net/
18
Questions?

Contenu connexe

Tendances

WCF Data Services - Bandung Charity Event - 2010
WCF Data Services  - Bandung Charity Event - 2010WCF Data Services  - Bandung Charity Event - 2010
WCF Data Services - Bandung Charity Event - 2010Andri Yadi
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)Jef Claes
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni InturiSreeni I
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST Ram Awadh Prasad, PMP
 
Node Session - 3
Node Session - 3Node Session - 3
Node Session - 3Bhavin Shah
 
Web performance across the HTTP to HTTPS transition
Web performance across the HTTP to HTTPS transitionWeb performance across the HTTP to HTTPS transition
Web performance across the HTTP to HTTPS transitionseanwalbran
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesBhavendra Chavan
 
Web Services
Web ServicesWeb Services
Web ServicesKrish
 
Office Track: Information Protection and Control in Exchange Online/On Premis...
Office Track: Information Protection and Control in Exchange Online/On Premis...Office Track: Information Protection and Control in Exchange Online/On Premis...
Office Track: Information Protection and Control in Exchange Online/On Premis...ITProceed
 
Intoduction to web services
Intoduction to web servicesIntoduction to web services
Intoduction to web servicesAhmed Gamil
 
Javaee7 jsr356-websocket
Javaee7 jsr356-websocketJavaee7 jsr356-websocket
Javaee7 jsr356-websocketJini Lee
 

Tendances (20)

Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
WCF Data Services - Bandung Charity Event - 2010
WCF Data Services  - Bandung Charity Event - 2010WCF Data Services  - Bandung Charity Event - 2010
WCF Data Services - Bandung Charity Event - 2010
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
REST
RESTREST
REST
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Node Session - 3
Node Session - 3Node Session - 3
Node Session - 3
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Web performance across the HTTP to HTTPS transition
Web performance across the HTTP to HTTPS transitionWeb performance across the HTTP to HTTPS transition
Web performance across the HTTP to HTTPS transition
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Intro to Web Sockets
Intro to Web Sockets Intro to Web Sockets
Intro to Web Sockets
 
Wcf remaining
Wcf remainingWcf remaining
Wcf remaining
 
Understanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differencesUnderstanding SOAP and REST basics and differences
Understanding SOAP and REST basics and differences
 
Web Services
Web ServicesWeb Services
Web Services
 
Office Track: Information Protection and Control in Exchange Online/On Premis...
Office Track: Information Protection and Control in Exchange Online/On Premis...Office Track: Information Protection and Control in Exchange Online/On Premis...
Office Track: Information Protection and Control in Exchange Online/On Premis...
 
Intoduction to web services
Intoduction to web servicesIntoduction to web services
Intoduction to web services
 
Javaee7 jsr356-websocket
Javaee7 jsr356-websocketJavaee7 jsr356-websocket
Javaee7 jsr356-websocket
 
Web services
Web servicesWeb services
Web services
 

En vedette

React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps. Emanuele DelBono
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overviewJesse Warden
 
Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Nir Kaufman
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.jsDoug Neiner
 
Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Minko Gechev
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesomeAndrew Hull
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practicesfloydophone
 

En vedette (10)

Java Script Best Practices
Java Script Best PracticesJava Script Best Practices
Java Script Best Practices
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps.
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.js
 
React js
React jsReact js
React js
 
Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Building Universal Applications with Angular 2
Building Universal Applications with Angular 2
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
Angular 2
Angular 2Angular 2
Angular 2
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 

Similaire à Why do you need REST

zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restfultom_li
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web servicesIurii Kutelmakh
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Kevin Lee
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-servicesrporwal
 
REST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesREST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesPaul Fremantle
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.pptKGSCSEPSGCT
 
Wcf rest api introduction
Wcf rest api introductionWcf rest api introduction
Wcf rest api introductionHimanshu Desai
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIsanandology
 
web programming
web programmingweb programming
web programmingshreeuva
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Pete Morano
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 

Similaire à Why do you need REST (20)

Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
Mini-Training: Let's have a rest
Mini-Training: Let's have a restMini-Training: Let's have a rest
Mini-Training: Let's have a rest
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restful
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web services
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
 
REST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesREST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and Lies
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
Web api
Web apiWeb api
Web api
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
Wcf rest api introduction
Wcf rest api introductionWcf rest api introduction
Wcf rest api introduction
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIs
 
web programming
web programmingweb programming
web programming
 
Unerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIsUnerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIs
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 

Plus de Mayank Srivastava

CNUG - Effective Data Visualization
CNUG - Effective Data VisualizationCNUG - Effective Data Visualization
CNUG - Effective Data VisualizationMayank Srivastava
 
CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...
CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...
CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...Mayank Srivastava
 
CNUG ASP.NET MVC 4 – New Features
CNUG ASP.NET MVC 4 – New FeaturesCNUG ASP.NET MVC 4 – New Features
CNUG ASP.NET MVC 4 – New FeaturesMayank Srivastava
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Mayank Srivastava
 

Plus de Mayank Srivastava (8)

Microsoft DevOps Journey
Microsoft DevOps JourneyMicrosoft DevOps Journey
Microsoft DevOps Journey
 
CNUG - Effective Data Visualization
CNUG - Effective Data VisualizationCNUG - Effective Data Visualization
CNUG - Effective Data Visualization
 
CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...
CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...
CNUG - Getting started on IoT Devices & Solutions using Windows 10 & Microsof...
 
CNUG TDD June 2014
CNUG TDD June 2014CNUG TDD June 2014
CNUG TDD June 2014
 
CNUG ASP.NET MVC 4 – New Features
CNUG ASP.NET MVC 4 – New FeaturesCNUG ASP.NET MVC 4 – New Features
CNUG ASP.NET MVC 4 – New Features
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 

Dernier

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Dernier (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Why do you need REST

  • 1. © 2012 MPS Partners.. All rights reserved. Why do you need REST June 27, 2013 Brown Bag presentation by: Mayank Srivastava www.MayankSrivastava.com
  • 2. Agenda o Understanding REST o REST Vs. SOAP o Web API Vs. WCF o Web API features.
  • 5. 5 What is SOAP? • An XML info set based on messaging protocol. • SOAP messages have an envelope, headers and a body • Transport neutral “interoperable” model. • RPC based development approach.
  • 6. 6 What is REST • REST = Representational State Transfer – As introduced by Roy Fielding in 2000 • REST is the architectural style for the Web, to building services hosted and consumed over HTTP. Uniform interface, HTTP Data formats & Content types, client-server, stateless, cacheable, scalable. General Use of terms: RESTful Service  HTTP Service  No SOAP WEB API == HTTP Service == RESTful Service.
  • 7. 7 REST Vs. SOAP • SOAP focuses on verbs (methods) while REST focuses on noun (resource) SOAP: .GetProduct() .UpdateLocations() .DeleteUser() REST: (Uniform Interface HTTP verbs) Product { } Location { } User { } With SOAP you define custom operation that tunnel thru POST SOAP is a message protocol where REST is an architectural design for the web
  • 8. 8 Why REST? • Do you need transport neutrality? • Do you need WS* features? • Benefits of already developed Web features like caching and scalability. • Basic SOAP is just like REST but without the benefits. • Fewer code transition layers • It is the standard for communication in the “cloud”. • Universal interface that everyone understands.
  • 9. 9 Why REST? What about security? All the your Web application supports • Token based • Active directory • OAuth 2.0 Client Server Resource request   Redirect to credential challenge Credentials   Links and tokens to access resource & access token
  • 10. 10 Universal interface that everyone understands. Your RESTful Service
  • 11. 11 Example SOAP message over HTTP POST http://wcftest.azurewebsites.net/Service1.svc HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8; action="http://tempuri.org/IStockTicker/GetQuote" Host: wcftest.azurewebsites.net Content-Length: 168 <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Body> <GetQuote xmlns="http://tempuri.org/"> <stockTicker>MSFT</stockTicker> </GetQuote> </s:Body> </s:Envelope> </s:Envelope> ______________________________________________________________________________________________________________________ HTTP/1.0 200 OK Content-Length: 187 Content-Type: application/soap+xml; charset=utf-8 <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Body> <GetQuoteResponse xmlns="http://tempuri.org/"> <GetQuoteResult>28.33</GetQuoteResult> </GetQuoteResponse> </s:Body> </s:Envelope>
  • 12. 12 Example “RESTful” request/response GET http://webapitest.azurewebsites.net/stocks?symbol=msft HTTP/1.1 Host: webapitest.azurewebsites.net ______________________________________________________________________________________________________________________ HTTP/1.0 200 OK Content-Length: 5 Content-Type: application/json; charset=utf-8 33.12
  • 13. 13 Why SOAP • SOAP interoperability is a requirement • Non HTTP transports - TCP, UDP, Named Pipes, MSMQ, custom bindings • WS-* based security.
  • 14. 14 Implementation Options WCF • WCF classic • WCF Data Services • WCF RIA Services • WCF Web HTTP (aka WCF REST) ASP.NET • ASP.NET Web Services • ASP.NET MVC • ASP.NET Web API • ASP.NET Web API OData • ASP.NET SignalR
  • 15. 15 Recommendation: WCF • WCF classic • WCF Data Services • WCF RIA Services • WCF Web HTTP (aka WCF REST) ASP.NET • ASP.NET Web Services • ASP.NET MVC • ASP.NET Web API • ASP.NET Web API OData • ASP.NET SignalR For SOAP ------ WCF classic For REST ------ ASP.NET WEB API
  • 16. 16 ASP.NET Web API (Code Demos) • Simplicity • Self Hosting • Consuming from Server Side. • Attribute routing - http://attributerouting.net/ • OData (emerging functionalities)
  • 17. 17 ASP.NET SignalR (Code Demos) • Web socket based communication. • Falls back to poll approach in the browser doesn’t support Web socket. • http://signalr.net/