The middleware triggers the invocation of this handler to unbind the Service Instance from its owning Session.

C# |
public virtual void OnSessionLeave()

This handler should do any cleanup for any resources that were used in the [OnSessionEnter] method. Exceptions that are thrown in onSessionLeave are not returned to the client, they are logged in the SIM log file. Default implementation does nothing.

Exception | Condition |
---|---|
[SoamException] | The application developer can throw SoamException (or subclassed exceptions: FailureException or FatalException) from this method to indicate that an error occurred while executing the logic to unbind the service instance from its binding session. |

[ServiceContainer.OnSessionEnter]