Step 5: Restore the session in any 4GL web operation from the state variable

In any publish 4GL web function, the SOAP engine deserializes the HTTP Cookie called GSESSIONID from the HTTP layer into the state variable. You can then retrieve the session in 4GL via that state variable.

For example:
FUNCTION MyFunction()
  IF ServiceState IS NULL THEN
    CALL com.WebServiceEngine.SetFaultString("Invalid session id")
    RETURN
  ELSE
    ... Restore the service session based on the ServiceState
        variable from the database
  END IF
  ... Process the operation
END FUNCTION