OpenSession

The OpenSession method validates the user’s identity and creates a new session in the application. This is essentially the same as the user logging into the application where the caller can communicate with the IDO.

Example

This example code opens a client session that accesses the IDO runtime using credentials such as the user ID, user password, and the configuration name. It also uses the URL in requestServiceURL, where the URL follows this pattern:

http://servername/IDORequestService/RequestService.aspx

where servername is the DNS or IP address of the server on which the Mongoose application/configuration resides.

bool logonSucceeded = false;
Client client = new Client( requestServiceURL, IDOProtocol.Http );
OpenSessionResponseData response = default( OpenSessionResponseData );
 
using ( client )
{
   // Substitute a valid username, password, and configuration name:
   response = client.OpenSession( username, password, config );
   logonSucceeded = response.LogonSucceeded;
}
Note: For the second argument for Client, you can also use IDOProtocol.Ipc. This indicates that the client class should connect to the IDO Runtime Service on the local machine. In this case, requestServiceURL is ignored.

This is equivalent to using the default constructor:

Client client = new Client();