SessionLogin

 

Dovico.TrackITWSAPI.API.SessionLogin(Dovico.TrackITAPI.CConnectionInfo,System.String,System.String,System.String)

 

 

Function Overview:

Call this function to log in to the web services business logic. Use the returned SessionToken to make all following web services calls (this will authenticate you). When done with web services, call SessionLogout. Note all parameters are encrypted using web service method EncryptString. If you are concerned with passing sensitive database information as clear text for the original encryption, than it is best to call the web service using https rather than http.

 

 

Parameter List:

ciConnInfo - ConnectionInfo - Connection information needed to create the initial Session Token. All properties must be encrypted.

sUserID - string - The encrypted user id for the user accessing Track-IT

sPassword - string - The encrypted password the the user accessing Track-IT

sClientType - string - Type of client accessing the API. Defined under CONSTANTS.CLIENT_*. Use the appropriate constant for the appropriate client (Track-IT light == CONSTANTS.CLIENT_TET_LIGHT)

 

Returns

A valid SessionToken to be used for all other calls to web services.

 

Example:

// first initialize the web services API proxy

WSAPI.API wsapi = new WSAPI.API();

// we set the timeout to -1 which means that by default methods have

// an infinite amount of time to finish processing on the server

wsapi.Timeout = -1;

// initialize database connection information.

// Note that we are encrypting all connection information here

WSAPI.CConnectionInfo ciConnInfo = new WSAPI.CConnectionInfo();

ciConnInfo.DatabaseName = wsapi.EncryptString("ExampleDatabase");

ciConnInfo.SQLServer = wsapi.EncryptString("ExampleServerName");

ciConnInfo.SQLUserID = wsapi.EncryptString("sa");

ciConnInfo.SQLPassword = wsapi.EncryptString("ExamplePassword");

// call the Login method so we can obtain a session token

WSAPI.SessionToken stToken = wsapi.SessionLogin(ciConnInfo, wsapi.EncryptString("ADMIN"), wsapi.EncryptString("ADMIN"), "API");