Page tree

EWLogout

Syntax

 void ew.EWLogout(String sessionId);

Usage

Use EWLogout call to explicitly indicate the end of the session to facilitate freeing up of the server resources. 

Generally, client applications are not required to logout. Sessions will expire automatically after a predetermined length of inactivity, which can be configured via the global variable "disconnect_timeout". However, the explicit logout ensures that the server resources are freed up faster which aids scalability. 

It is advisable to enclose the EWLogout call in the Java finally block, or equivalent in other languages.

Sample Code - Java

 public String login() {
    EWServiceAPI binding = new EWServiceAPIServiceLocator().getMyKB();
    String sessionId = binding.EWLogin("MyKB", "A", "password", "en");
    try {
    doSomeOperations(binding, sessionId);
    finally {
    binding.EWLogout(sessionId);
    }
    }

You can generate a sample Web Services code for any table by selecting Setup > Tables > [Select Table to Edit] > API > Download Sample.

Arguments

Name

Type

Description

sessionId

String

Session token

Faults

EWUnexpectedException - an unexpected exception has happened; user should report this for investigation.