The WebService class / com.WebServices methods |
Creates a new object to implement a stateful Web Service.
com.WebService.CreateStatefulWebService( name STRING, namespace STRING, state state-type ) RETURNING result com.WebService
The com.WebService.CreateStatefulWebService() class method creates a new com.WebService object implementing a Web Service that is stateful.
The name and namespace must uniquely identify the Web Service across the entire application, when multiple Web Service programs run on the same server. In theory, namespace+name must be unique on the internet.
The state variable used to identify the state between the client and the server:
RECORD ATTRIBUTES(W3CEndpointReference) address STRING, -- The location of the Web Service (for ex: URL) ref RECORD ... (other members defining the state) END RECORD END RECORD
It is up to the programmer to manage the state variable and to restore the service state from a database.
When creating a stateful Web Service, all published Web Operations require a session in the client request excepted those defined as 'initiateSession'.
In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).