3 ms·
> However at least SOAP is a spec and generally works. SOAP has several versions of the spec and a bunch of vendor-specific cruft. The SOAP use-cases from this
by generalk 16y ago
> However at least SOAP is a spec and generally works.
SOAP has several versions of the spec and a bunch of vendor-specific cruft. The SOAP use-cases from this comment thread are enough indication of that.
> REST is an architectural style there is no spec, just a idea!
Yeah, but you use REST every day in your web browser. A lot of the times it isn't strongly RESTful, but it's still REST. For example, to view this comment thread and post your reply to someone's comment.
In SOAP, if I call the getUserByID(42) method on your end, and you don't have a user with id 42, what do you do? Do you return an empty response? Do you return some kind of SOAPFault? If so, what kind?
In REST, if I GET http://yourservice.com/users/42 http://yourservice.com/users/42 and you don't have user 42, I get HTTP 404. That's the only logical response.
> Implementing a client for REST based services often requires a bunch of (generally simple) coding which takes time and is error prone.
This is no different from SOAP, with the exception that with SOAP you have to have your requests stuffed into XML by some libraries which have read some other autogenerated XML to figure out how to stuff your requests.
With REST, you can write a library (that wraps HTTP calls), or you can use curl, or (for simple GET requests) you can use your browser. Your platform might not support SOAP, but it definitely supports REST.
> Also pure REST is really good for building data access/CRUD services but makes it hard to build RPC type services without mangling the semantics.
This has been said multiple times but let's say it again:
REST is not RPC.
If you're looking to remotely call procedures on your app, REST isn't going to provide that.
The only case where REST doesn't work is the case where your client demands SOAP. In any other case, REST works beautifully. Not everyone does REST right, but even when it's done suboptimally (e.g. not providing hyperlinks to related resources) it's still worlds better than SOAP.