SlideShare ist ein Scribd-Unternehmen logo
1 von 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/

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (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
 

Andere mochten auch

SAP TechEd 2010 highlights
SAP TechEd 2010 highlightsSAP TechEd 2010 highlights
SAP TechEd 2010 highlights
Sascha Wenninger
 
Sap pi overview
Sap pi overviewSap pi overview
Sap pi overview
smavachee
 

Andere mochten auch (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
 

Ähnlich wie REST - A Super Quick Intro

RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
Li Yi
 
WCF from the web developer
WCF from the web developerWCF from the web developer
WCF from the web developer
Florin Cardasim
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 
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)
Sascha Wenninger
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
vikram singh
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
vikram singh
 
Communication Protocols And Web Services
Communication Protocols And Web ServicesCommunication Protocols And Web Services
Communication Protocols And Web Services
Omer Katz
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
panagenda
 
+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

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/