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>
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
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!