RESTA Super-Quick Introduction
REpresentationalStateTransfer
Say What???
Apply ‘Web’ Principles to A2A Integration Problems
Remember the OSI Stack?http://en.wikipedia.org/wiki/Osi_stack
So what?
REST uses HTTP as the Application Protocol!Not (just) as the transport
How does that work?
Standard VerbsThe HTTP Spec give you the verbs to use:GETPUTPOSTDELETEHEADOPTIONSPATCHTRACEhttp://en.wikipedia.org/wiki/HTTP#Request_methods
SOAP Doesn’t…getAccountCustomerByInternalIdsearchCustomerByBasicDataupdateSalesProspectStatusByPartnerSalesRepresentativeBasicData_syncEverything works via HTTP POST(i.e. uses HTTP as the dumb transport)
Status CodesThe HTTP Spec give you the verbs to use:200 OK302 Moved Permanently404 Not Found406 Method Not Allowed418 I’m a Teapot…http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
SOAP Doesn’t…<SOAP-ENV:Faultxmlns:sqlsoapfaultcode="http://schemas.microsoft.com/sqlserver/2004/SOAP/SqlSoapFaultCode">  <faultcode>SOAP-ENV:Client</faultcode>  <faultstring>There was an error in the incoming SOAP request packet:  Client, InvalidXml</faultstring>  <faultactor>http://schemas.microsoft.com/sqlserver/2004/SOAP</faultactor>  <detail xmlns:SOAP-1_2-ENV="http://www.w3.org/2003/05/soap-envelope">    <SOAP-1_2-ENV:Code>      <SOAP-1_2-ENV:Value>SOAP-1_2-ENV:Sender</SOAP-1_2-ENV:Value>      <SOAP-1_2-ENV:Subcode>         <SOAP-1_2-ENV:Value>sqlsoapfaultcode:InvalidXml</SOAP-1_2-ENV:Value>      </SOAP-1_2-ENV:Subcode>    </SOAP-1_2-ENV:Code>    <SOAP-1_2-ENV:Reason>      <SOAP-1_2-ENV:Text xml:lang="en-US">There was an error in the incoming SOAP request packet:  Sender, InvalidXml</SOAP-1_2-ENV:Text>    </SOAP-1_2-ENV:Reason>    <SOAP-1_2-ENV:Node>http://MyServer:80/sql</SOAP-1_2-ENV:Node>    <SOAP-1_2-ENV:Role>http://schemas.microsoft.com/sqlserver/2004/SOAP</SOAP-1_2-ENV:Role>    <SOAP-1_2-ENV:Detail>      <sqlresultstream:SqlMessagexsi:type="sqlmessage:SqlMessage">         <sqlmessage:Class>16</sqlmessage:Class>         <sqlmessage:LineNumber>0</sqlmessage:LineNumber>         <sqlmessage:Message>XML parsing: line 3, character 0, incorrect document syntax</sqlmessage:Message>         <sqlmessage:Number>9422</sqlmessage:Number>         <sqlmessage:Source>Microsoft-SQL/9.0</sqlmessage:Source>         <sqlmessage:State>1</sqlmessage:State>      </sqlresultstream:SqlMessage>    </SOAP-1_2-ENV:Detail>  </detail></SOAP-ENV:Fault>
So What’s Wrong with that?
So What’s Wrong with that?Suboptimal
ScalabilityHTTP GET is the most optimised piece of code on the planet!Easily cached to support millions of clientsDefined semanticsHTTP = Application ProtocolEveryone knows how to do a GETEveryone knows how to behave
We Exchange Representations
Representations?The server can store its data/objects in whatever way it likesThe clients can store the same stuff differentlyWe serialise that into Representations
Less Abstract…A Website is a Representation of the server’s database, code, etc.Clients don’t care how the server stores it, as long as it understands the Representation
State Transfer?
State is Transferred between Server and ClientNot just kept at the Server!
Client requests Shopping CartServer sends HTML page with items and linksClient’s moveClient clicks “Check Out”Server sends HTML page with Total AmountClient’s moveClient clicks “Pay”Server sends HTML page with “Thank You”and we’re done!
Notice Something?
The Client Drives the InteractionResponsible for moving forwardOr not!The server guides the client forward(with ‘Check Out’, ‘Pay’ links)The client is responsible for completing the processIf the client stops, the server doesn’t care!
And…
Everything has a URL
So it’s like the Web!…Just for Machines
Restbucksworks with whisky too ;-)http://www.infoq.com/articles/webber-rest-workflow
So, the Formal Principles:
REST PrinciplesIdentify Resources (URLs)Manipulate Resources through RepresentationsSelf-Descriptive MessagesHATEOAShttp://www.infoq.com/articles/rest-introduction
HypertextAsTheEngineOfApplicationState
In other words:Linking Things TogetherDriving the Process via LinksLike the ‘Check Out’ link!
…and some Constraints:Client-ServerStatelessCacheableLayered SystemUniform InterfaceDuh!= scalable= scalableload balancers, proxiesHTTP verbs & codes
Finally:http://geekandpoke.typepad.com/geekandpoke/2009/11/service-calling-made-easy-part-1.html
REST - A Super Quick Intro
More Resources:http://en.wikipedia.org/wiki/RESThttp://www.infoq.com/resthttp://www.infoq.com/articles/webber-rest-workflowhttp://www.infoq.com/minibooks/emag-03-2010-rest (Excellent FREE eBook)CD108 from 2010 TechEdhttps://www.ibm.com/developerworks/webservices/library/ws-restful/

More Related Content

PPT
Web of Science: REST or SOAP?
PPTX
Implementation advantages of rest
PPTX
Introduction To REST
PPT
Get_vs_Post
PPTX
ODP
The Internet as Web Services: introduction to ReST
PPT
RESTful services
PPTX
Understanding REST APIs in 5 Simple Steps
Web of Science: REST or SOAP?
Implementation advantages of rest
Introduction To REST
Get_vs_Post
The Internet as Web Services: introduction to ReST
RESTful services
Understanding REST APIs in 5 Simple Steps

What's hot (8)

PDF
SOAP-based Web Services
KEY
SJUG March 2010 Restful design
PPT
PPTX
Soap vs rest
PDF
What is REST API? REST API Concepts and Examples | Edureka
PDF
Learn REST in 18 Slides
PPT
Soap and Rest
PPTX
Wcf for the web developer
SOAP-based Web Services
SJUG March 2010 Restful design
Soap vs rest
What is REST API? REST API Concepts and Examples | Edureka
Learn REST in 18 Slides
Soap and Rest
Wcf for the web developer
Ad

Viewers also liked (9)

PPT
SAP TechEd 2010 highlights
PPTX
REST: So What's It All About? (SAP TechEd 2011, MOB107)
PPTX
The CSV File Strikes Back
PPTX
Lessons Learnt Implementing High-Performance Integration using SAP PI
PPT
Sap pi overview
PPTX
Build your Own Technology Roadmap!
PPT
SAP Systems Integration by SAP PI (XI)
PPTX
Getting started with SAP PI/PO an overview presentation
PPTX
SAP PI and SOA Overview
SAP TechEd 2010 highlights
REST: So What's It All About? (SAP TechEd 2011, MOB107)
The CSV File Strikes Back
Lessons Learnt Implementing High-Performance Integration using SAP PI
Sap pi overview
Build your Own Technology Roadmap!
SAP Systems Integration by SAP PI (XI)
Getting started with SAP PI/PO an overview presentation
SAP PI and SOA Overview
Ad

Similar to REST - A Super Quick Intro (20)

PPT
Server-side Technologies in Java
PPT
KMUTNB - Internet Programming 2/7
PPT
Web services - REST and SOAP
PPS
RIA and Ajax
PPT
Restful web services
PPT
RESTful SOA - 中科院暑期讲座
PPTX
WCF from the web developer
PPT
Intro to web services
PPTX
Ellerslie User Group - ReST Presentation
PPTX
There is time for rest
PDF
REST - What's It All About? (SAP TechEd 2012, CD110)
PPTX
C# REST API
PPT
An Introduction To Java Web Technology
PPTX
C:\fakepath\jsp01
PPT
Web Tech Java Servlet Update1
PDF
Jsp & Ajax
PPTX
Switch to Backend 2023 | Day 1 Part 1
PPTX
Communication Protocols And Web Services
Server-side Technologies in Java
KMUTNB - Internet Programming 2/7
Web services - REST and SOAP
RIA and Ajax
Restful web services
RESTful SOA - 中科院暑期讲座
WCF from the web developer
Intro to web services
Ellerslie User Group - ReST Presentation
There is time for rest
REST - What's It All About? (SAP TechEd 2012, CD110)
C# REST API
An Introduction To Java Web Technology
C:\fakepath\jsp01
Web Tech Java Servlet Update1
Jsp & Ajax
Switch to Backend 2023 | Day 1 Part 1
Communication Protocols And Web Services

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
Modernising the Digital Integration Hub
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPT
Geologic Time for studying geology for geologist
PDF
Unlock new opportunities with location data.pdf
PPTX
observCloud-Native Containerability and monitoring.pptx
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPTX
The various Industrial Revolutions .pptx
PDF
STKI Israel Market Study 2025 version august
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Five Habits of High-Impact Board Members
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
A novel scalable deep ensemble learning framework for big data classification...
1 - Historical Antecedents, Social Consideration.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Developing a website for English-speaking practice to English as a foreign la...
Modernising the Digital Integration Hub
O2C Customer Invoices to Receipt V15A.pptx
Geologic Time for studying geology for geologist
Unlock new opportunities with location data.pdf
observCloud-Native Containerability and monitoring.pptx
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
The various Industrial Revolutions .pptx
STKI Israel Market Study 2025 version august
Module 1.ppt Iot fundamentals and Architecture
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Five Habits of High-Impact Board Members
WOOl fibre morphology and structure.pdf for textiles
Web Crawler for Trend Tracking Gen Z Insights.pptx
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
A novel scalable deep ensemble learning framework for big data classification...

REST - A Super Quick Intro