SlideShare uma empresa Scribd logo
1 de 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/

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a REST - A Super Quick Intro

Semelhante a 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
 

Último

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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Último (20)

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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

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/