I don't have any reference to give here to show my research (because none of the links are to the point) and even Google doesn't have an exact answer. Everyone says web service is stateful but that's confusing. By principle, I believe, SOAP is stateful and REST is stateless. So, Why/How SOAP is stateful ?
#4) SOAP is state-full (not stateless) as it takes the entire request as a whole, unlike REST which provides independent processing of different methods. No independent processing is there in SOAP.
Finally, SOAP has built-in stateful operations. REST is naturally stateless, but SOAP is designed to support conversational state management.
This mean, soap provide mechanism to pass data between client and server. By design and main purpose SOAP is data protocl to be use between server and clients. Server(service) save, preserve and response data. Soap as data can be used in both variants in service - stateful or stateless.
Q. Is REST API stateless or stateful? A. REST APIs are stateless because, rather than relying on the server remembering previous requests, REST applications require each request to contain all of the information necessary for the server to understand it.
Basically Stateful means that server stores information about the client and uses that information over a series of requests. So performing one request is dependant upon the state of some other request (e.g. previous). Implementing this is possible with http protocols.
So you can have stateful or stateless SOAP - it's only a matter of how you design it.
Also please note that comparing SOAP and REST is not really correct. The first one is basically Protocol (or at least it's trying to be) and REST is just a architecture pattern/style.
I know this is not exactly answering your question but please take a look at this link: SOAP vs REST (differences) It's extremely well written and can help you understand those technologies a bit better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With