/// Application that will issue Login-Logoff request to Siebel
///
/// To run this program,
/// - Set ConnectString, Username and Password. ConnectString is of the format
/// siebel://host/EnterpriseServer/AppObjMgr/SiebelServer
/// (SiebelServer is required in case of Siebel 7.5)
/// For an example, please see the code below.
/// - Add a reference to sstchca.dll (found in siebel client install folder)
/// - Compile and run the program
/// - If the login fails, you will see an error message
using System;
using System.Runtime.InteropServices;
using SiebelBusObjectInterfaces;
namespace Sample
{
class Program
{
const string ConnectString = "host=\"siebel://adapsblsrvr77:2321/ent77/SSEObjMgr_enu";
const string Username = "abc";
const string Password = "def";
static void Main(string[] args)
{
SiebelDataControl sdc = null;
bool loggedIn = false;
try
{
/// Create a connection
sdc = new SiebelDataControl();
sdc.EnableExceptions(1);
sdc.Login(ConnectString, Username, Password);
loggedIn = true;
}
catch (COMException ex)
{
Console.WriteLine("ERROR: " + ex.ToString());
}
finally
{
if (sdc != null)
{
if (loggedIn)
{
sdc.Logoff();
}
Marshal.ReleaseComObject(sdc);
sdc = null;
}
}
Console.WriteLine("Press any key to terminate...");
Console.ReadLine();
}
}
}