Reputation:
During creating APIs, in what cases or scenerios the API creator should go for REST over SOAP API, and vice versa?
Upvotes: 0
Views: 82
Reputation: 118784
Nowadays, SOAP is mostly a legacy interface being usurped by JSON over HTTP. The only real reason to select SOAP today is for interoperability with other systems that are already committed to it. As a greenfield, brand new application, there's little reason to select SOAP.
That said, SOAP does offer some high level functionality over REST (streaming APIs, transport agnostic, formal asynchronous processing, lots of security options). All of these are formalized, which leads to many of the complaints about SOAP complexity.
SOAP is inherently simple -- envelope, header, and body. But the 100's of pages of standards dictating what goes in to those elements, and how they go in to those elements, that's where the complexity lies. But it's all necessary for interoperability.
But, yes, if you're starting something new from scratch, REST has learned some things from the SOAP experience, and can be much easier to use with lighter weight toolkits.
Upvotes: 1