SOA Tips-Stateless vs Stateful30 Apr 2007
WSDL-based Web Services define a stateless model and an unordered set of operations. WSDL and therefore WSDL-based web services do not have the concept of state. Do not use transport layer features to accomplish state management into your WSDL based web service. Dependency on HTTP and its session support to implement state management into your WSDL-based web services is a bad practice. To avoid issues with scalability, and provide deployment flexibility, web services should be stateless. If you want state management, you have to have the web service consumer implement this functionality.
A better alternative if you want state management, is to consider using BPEL for orchestration. Among other features, BPEL provides:
- The ability to define rules for ordering operations,
- The ability to sequence a set of operations,
- Support to build a stateful business process,
- The ability to support long-running business interactions,
- A well-defined business process instance lifecycle,
- Provide support for concurrency, and
- Support choreography with external entities.