In relation to this question, I have a follow up question that I am still confused over. I have been asked to compair REST vs Web Services. From what I have learnt about REST, it is not a web service, therefore how can you compair the two? What does the question mean when it says REST in this respect?
-
I consider REST to be a type of web service. Just like SOAP is a type of web service. Or RPC. Trying to "compare" them would be like trying to compare the automobile with a Ford Focus. It doesn't make sense. – Brian Donovan Jan 12 '11 at 01:01
-
1REST is an architectural style which can be used as a web service. It can also be used for other things, since it's an architectural style and not a specification! The difference between a RESTful WS and non RESTful WS is for example, a RESTful WS is required to be stateless in it's communication between server and client (look it up). And while SOAP primarily uses XML as it's format, from a RESTful web service you should be able to request almost any format (which you don't need to support), but you should be able to handle the client if it's not supported (HTTP 415). – Anders Jan 12 '11 at 01:02
-
And I still say you should read the thesis! – Anders Jan 12 '11 at 01:05
-
http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm – kenny Jan 12 '11 at 01:28
-
This has been asked countless times before. Use the search. – Avi Flax Jan 12 '11 at 13:52
4 Answers
REST is an architectural pattern for web services emphasizing the usage of URIs as resources with a small set of operations that may be performed on them (usually PUT, POST, GET, and DELETE). I'm guessing you are being asked to compare REST to the ws* standard web services which utilize a lot of other technologies (including SOAP, though SOAP itself is not a web service, it is just a protocol that happens to be used in ws* web services).

- 393
- 2
- 5
REST can be used to provide web services just like databases can be used to store names and addresses. REST is far more general purpose than simply a way of providing a web API.
REST is useful for building distributed systems. However, many people use Web Services (note the capitals, this usually denotes SOAP, WS-*) for building distributed systems.
Wow, I just saw the homework tag. That is one seriously mean question. There are industry veterans who could not come close to answering this question.
A more accurate question would be: Compare REST using HTTP versus RPC using SOAP for building distributed systems.

- 139,164
- 32
- 194
- 243
The abbreviation REST stands for "REpresentational State Transfer".
REST APIs are used to call resources and allow the software to communicate based on standardized principles, properties, and constraints. REST APIs operate on a simple request/response system. You can send a request using these HTTP methods.
Hence REST is just an API (an interface that allows you to build on the data and functionality of another application) architectural style.
On the other hand, web service is a network-based resource that fulfills a specific task. Yes, there's overlap between the two: all web services are APIs, but not all APIs are web services.

- 497
- 3
- 7