Removing Sessions

There may be situations where a session needs to be removed immediately; for example, when a user logs off. To do this, you can call the WebSession class removeSession method.

If you are removing the current session and want to return a specific message, you can call the WebSession class removeSessionWithMessage method, passing the message that you want to return.

In all other cases, if you want to send a message that differs from the default, you can reimplement the Application class removeSessionMessage method. Note, however that the string returned by this method must be a SOAP message. The response returned by this message is what will be returned to the web service client if a subsequent request uses the session id of the removed session.

One way to create a SOAP message in this case would be to create a JadeSOAPException instance, populate the errorCode, errorItem, and extendedErrorText properties, and then call the createSOAPMessage method to generate the SOAP‑formatted message.