REST (Representational State Transfer) is an architectural style which imposes restriction on the client-server design - like stateless communication between client and server, caching at the client server side, uniform methods etc.. REST style advocates to define everything in terms of Resources which has Representaion of its State that can be Read, Write, Updated and Deleted. Resources can be represented in any format but mostly xml or json is used. Unlike SOAP, messages in REST are not mapped to any resource specific method calls but they are just well formed (resource) information which are parsed at server side and processed as per business logic - Parsing can be done by any means like normal String parsing, SAX, DOM, Streaming parsing, JAXB parsing etc. Unlike SOAP, REST does not restrict message format or usage of tools.
| Soap (Simple Object Access Protocol) | Rest (Representational State Transfer) |
|---|---|
| Strict messaging format as defined by SOAP | Free format. Mostly XML or JSON. |
| Operation or RPC oriented | Resource oriented |
| Soap Messages are basically remote method calls with arguments and exceptions and return types. Soap messages, in/out types, faults are actually converted, mapped and invoked to the remote object's method, arguments and responses, and exceptions respectively at the remote side. |
Rest Messages are well formed information and are parsed using XML parsers. Sometimes messages are converted into objects. |
| Practically heavily dependent on SOAP based tools both at Server and Client side. | Dependency on tools are optional |
| Messages are machine readable. | Messages are human readable. |
| Messages, operations conversions are complex. | Lightweight. |
.png)