About Rest and the Web
Representational State Transfer or rest is the simplest terms is a way of accessing and modifying resources in a format that is easily understood. I, like many, though it was just how HTTP sends and receives data for a browser to render. Didn’t know there was so much more to the story.
Awesome layman’s explanation. I highly recommend you get that first coffee and get comfortable before embarking on this one. If it wasn’t as interesting a read it would certainly be in the TL;DR category.
http://tomayko.com/writings/rest-to-my-wife
After this I began to wonder the the heck was the point of SOAP requests
and I was not the only one.
http://stackoverflow.com/questions/686634/soap-whats-the-point
I mean look at a Rest request and response.
*material found here (http://www.jmarshall.com/easy/http/#structure)*
Request:To retrieve the file at the URL:
1 |
http://www.somehost.com/path/file.html |
1 2 3 4 5 |
GET /path/file.html HTTP/1.0 From: someuser@jmarshall.com User-Agent: HTTPTool/1.0 [blank line here] |
Response:The server should respond with something like the following, sent back through the same socket
1 2 3 4 5 6 7 |
HTTP/1.0 200 OK Date: Fri, 31 Dec 1999 23:59:59 GMT Content-Type: text/html Content-Length: 1354 |
Happy New Millennium!
1 2 3 4 5 6 7 |
(more file contents) . . . |
1 |
And take a look at request and response in Soap
Request: GetStockPrice request is sent to a server. The request has a StockName parameter
POST /InStock HTTP/1.1
1 2 3 4 5 6 7 8 9 10 11 12 |
Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <!--?xml version="1.0"?--> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> IBM |
Response:
a Price parameter that will be returned in the response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <!--?xml version="1.0"?--> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> 34.5>/m:Price> |
While Lines of code != Complexity in all cases, I think it would be a fair way of summarizing this particular one.
Additional comparison notes on Wikipedia
http://en.wikipedia.org/wiki/REST#SOAP_RPC_contrast