Concept

A stateful service is a service that maintains a context between a Web services client and server.

It enables the service to keep track of previous requests from that context, in order to manage different states in the Web service server.

SOAP stateful Web service

Genero Web Services supports two kinds of stateful services:

  • Based on the WS-Addressing 1.0 specification to define the XML format used to convey the context from the client to the server.

  • Based on an HTTP session cookie to convey the context from the client to the server.

The Genero Web Service engine uses a BDL variable defined at stateful service creation via createStatefulWebService() as service context. Use that variable to hold a service state in a database.

It is up to the BDL programmer to create, store and remove the service state in the database.

The SOAP engine is responsible for:

  • Deserializing the state variable when getting a new incoming request. The programmer can then read the state variable for any published BDL Web service operation and restore the service state corresponding to that variable.

  • Serializing a new instance of the state variable in a Web service response for all BDL Web service operations set as session initiator via initiateSession(). The programmer must instantiate a new state by filling the state variable and storing it in a database for future use.