SlideShare une entreprise Scribd logo
1  sur  35
REST A 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 Verbs The HTTP Spec give you the verbs to use: GET PUT POST DELETE HEAD OPTIONS PATCH TRACE http://en.wikipedia.org/wiki/HTTP#Request_methods
SOAP Doesn’t… getAccountCustomerByInternalId searchCustomerByBasicData updateSalesProspectStatusByPartnerSalesRepresentativeBasicData_sync Everything works via HTTP POST (i.e. uses HTTP as the dumb transport)
Status Codes The HTTP Spec give you the verbs to use: 200 OK 302 Moved Permanently 404 Not Found 406 Method Not Allowed 418 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
Scalability HTTP GET is the most optimised piece of code on the planet! Easily cached to support millions of clients Defined semanticsHTTP = Application Protocol Everyone knows how to do a GET Everyone knows how to behave
We Exchange Representations
Representations? The server can store its data/objects in whatever way it likes The clients can store the same stuff differently We 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 Client Not just kept at the Server!
Client requests Shopping Cart Server sends HTML page with items and links Client’s move Client clicks “Check Out” Server sends HTML page with Total Amount Client’s move Client clicks “Pay” Server sends HTML page with “Thank You” and we’re done!
Notice Something?
The Client Drives the Interaction Responsible for moving forward Or not! The server guides the client forward (with ‘Check Out’, ‘Pay’ links) The client is responsible for completing the process If the client stops, the server doesn’t care!
And…
Everything has a URL
So it’s like the Web! …Just for Machines
Restbucks works with whisky too ;-) http://www.infoq.com/articles/webber-rest-workflow
So, the Formal Principles:
REST Principles Identify Resources (URLs) Manipulate Resources through Representations Self-Descriptive Messages HATEOAS http://www.infoq.com/articles/rest-introduction
HypertextAsTheEngineOfApplicationState
In other words: Linking Things TogetherDriving the Process via Links Like the ‘Check Out’ link!
…and some Constraints: Client-Server Stateless Cacheable Layered System Uniform Interface Duh! = scalable = scalable load balancers, proxies HTTP verbs & codes
Finally: http://geekandpoke.typepad.com/geekandpoke/2009/11/service-calling-made-easy-part-1.html
More Resources: http://en.wikipedia.org/wiki/REST http://www.infoq.com/rest http://www.infoq.com/articles/webber-rest-workflow http://www.infoq.com/minibooks/emag-03-2010-rest (Excellent FREE eBook) CD108 from 2010 TechEd https://www.ibm.com/developerworks/webservices/library/ws-restful/

Contenu connexe

Tendances

SJUG March 2010 Restful design
SJUG March 2010 Restful designSJUG March 2010 Restful design
SJUG March 2010 Restful designMichael Neale
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaEdureka!
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 SlidesSuraj Gupta
 

Tendances (8)

SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
 
SJUG March 2010 Restful design
SJUG March 2010 Restful designSJUG March 2010 Restful design
SJUG March 2010 Restful design
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Wcf for the web developer
Wcf for the web developerWcf for the web developer
Wcf for the web developer
 

En vedette

SAP TechEd 2010 highlights
SAP TechEd 2010 highlightsSAP TechEd 2010 highlights
SAP TechEd 2010 highlightsSascha Wenninger
 
REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)Sascha Wenninger
 
Lessons Learnt Implementing High-Performance Integration using SAP PI
Lessons Learnt Implementing High-Performance Integration using SAP PILessons Learnt Implementing High-Performance Integration using SAP PI
Lessons Learnt Implementing High-Performance Integration using SAP PISascha Wenninger
 
Sap pi overview
Sap pi overviewSap pi overview
Sap pi overviewsmavachee
 
Build your Own Technology Roadmap!
Build your Own Technology Roadmap!Build your Own Technology Roadmap!
Build your Own Technology Roadmap!Sascha Wenninger
 
SAP Systems Integration by SAP PI (XI)
SAP Systems Integration by SAP PI (XI)SAP Systems Integration by SAP PI (XI)
SAP Systems Integration by SAP PI (XI)alpercelk
 
Getting started with SAP PI/PO an overview presentation
Getting started with SAP PI/PO an overview presentationGetting started with SAP PI/PO an overview presentation
Getting started with SAP PI/PO an overview presentationFigaf.com
 

En vedette (9)

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

Similaire à REST - A Super Quick Intro

Similaire à REST - A Super Quick Intro (20)

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

Dernier

Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 

Dernier (20)

Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 

REST - A Super Quick Intro

  • 1. REST A Super-Quick Introduction
  • 4. Apply ‘Web’ Principles to A2A Integration Problems
  • 5. Remember the OSI Stack? http://en.wikipedia.org/wiki/Osi_stack
  • 7. REST uses HTTP as the Application Protocol! Not (just) as the transport
  • 9. Standard Verbs The HTTP Spec give you the verbs to use: GET PUT POST DELETE HEAD OPTIONS PATCH TRACE http://en.wikipedia.org/wiki/HTTP#Request_methods
  • 10. SOAP Doesn’t… getAccountCustomerByInternalId searchCustomerByBasicData updateSalesProspectStatusByPartnerSalesRepresentativeBasicData_sync Everything works via HTTP POST (i.e. uses HTTP as the dumb transport)
  • 11. Status Codes The HTTP Spec give you the verbs to use: 200 OK 302 Moved Permanently 404 Not Found 406 Method Not Allowed 418 I’m a Teapot … http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
  • 12. 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>
  • 13. So What’s Wrong with that?
  • 14. So What’s Wrong with that? Suboptimal
  • 15. Scalability HTTP GET is the most optimised piece of code on the planet! Easily cached to support millions of clients Defined semanticsHTTP = Application Protocol Everyone knows how to do a GET Everyone knows how to behave
  • 17. Representations? The server can store its data/objects in whatever way it likes The clients can store the same stuff differently We serialise that into Representations
  • 18. 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
  • 20. State is Transferred between Server and Client Not just kept at the Server!
  • 21. Client requests Shopping Cart Server sends HTML page with items and links Client’s move Client clicks “Check Out” Server sends HTML page with Total Amount Client’s move Client clicks “Pay” Server sends HTML page with “Thank You” and we’re done!
  • 23. The Client Drives the Interaction Responsible for moving forward Or not! The server guides the client forward (with ‘Check Out’, ‘Pay’ links) The client is responsible for completing the process If the client stops, the server doesn’t care!
  • 26. So it’s like the Web! …Just for Machines
  • 27. Restbucks works with whisky too ;-) http://www.infoq.com/articles/webber-rest-workflow
  • 28. So, the Formal Principles:
  • 29. REST Principles Identify Resources (URLs) Manipulate Resources through Representations Self-Descriptive Messages HATEOAS http://www.infoq.com/articles/rest-introduction
  • 31. In other words: Linking Things TogetherDriving the Process via Links Like the ‘Check Out’ link!
  • 32. …and some Constraints: Client-Server Stateless Cacheable Layered System Uniform Interface Duh! = scalable = scalable load balancers, proxies HTTP verbs & codes
  • 34.
  • 35. More Resources: http://en.wikipedia.org/wiki/REST http://www.infoq.com/rest http://www.infoq.com/articles/webber-rest-workflow http://www.infoq.com/minibooks/emag-03-2010-rest (Excellent FREE eBook) CD108 from 2010 TechEd https://www.ibm.com/developerworks/webservices/library/ws-restful/