I had a concept that HTTP is stateless, so SOAP over HTTP (for web services) is also stateless. I used to think that state meant “state of the object”. For an example, suppose I have a class called Employee
and methods called setSalary
and getSalary
. If a caller of the web service calls setSalary
and makes the salary 1000, then if getSalary
is called, the caller should not necessarily get the value 10000. When I tested getsalary
and got 1000 (i.e., the value assigned by setSalary
), I was wondering how the state of the Employee
object was maintained.
The Stack Overflow question Webservices are stateless? mentions tricks like cookies used to maintain state, but since I did not made any explicit effort to maintain state, how was the state of the Employee
object maintained?
Please let me know if I have misunderstood the concept of state/stateless altogether.