Page tree

EWLogin

Syntax

 String sessionId = ew.EWLogin(String KB, String user, String
    password, String language);

Usage

Use the EWLogin call to log in to Agiloft and start a client session. A client application must log in and obtain the session token (sessionId) before making any other API calls. 

When the client application invokes the EWLogin call, it passes the knowledgebase name - not the label - the username and the password as user credentials. The language code is used in localization of error messages. Specify "en" for English if not sure. 

After logging in the client has to pass the obtained session token with every subsequent call as a parameter.

Example Task

Log into MyKB knowledgebase as user A with password "password" and English as the local language. 

The task is completed by performing the following steps:

  1. Obtain the Service SOAP stub.
  2. Call EWLogin.
  3. Handle results.

Sample Code - Java

public String login() {
    EWServiceAPI binding = new EWServiceAPIServiceLocator().getMyKB();
    String sessionId = binding.EWLogin("MyKB", "A", "password", "en");
    return 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

KBName

String

The name of the KB to log into.

user

String

The username to be used to create the session defines access privileges for all further calls within this session.

password

String

The corresponding password.

language

String

ISO-639 language code ("en", "de", "fr").

Response

The session token to be used in all subsequent calls.

Faults

EWPermissionException - user lacks the sufficient privileges to log in. 

EWWrongDataException - the parameters supplied are not valid to log in. 

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