ISilentSessionLogin::InitializeWithCredentials

The InitializeWithCredentials method initializes the client application's StdSessionLogin component for the login session to FileNet Workplace, including specifying the user name and password login credentials, and providing a pointer to an IBaseServerURL interface containing information about the Application Engine server, port number, client application, and the security of HTTP during the session.

void spISilentSessionLogin->InitializeWithCredentials(_bstr_t bstrUserName,
                                                      _bstr_t bstrUserPassword,
                                                      IBaseServerUrlPtr spIBaseServerURL);
Parameters
bstrUserName - [in] Required _bstr_t, which specifies the name of the user to use for the login credentials for the SilentSessionLogin component.
bstrUserPassword - [in] Required _bstr_t, which specifies the password of the user to use for the login credentials for the SilentSessionLogin component.
spIBaseServerURL - [in] Required pointer to an IBaseServerURL interface, which specifies the Application Engine server, port, and client application for the session.
Results
If the InitializeWithCredentials method successfully initializes the SilentSessionLogin component, the method returns an HRESULT value of S_OK; otherwise it returns E_INVALIDARG. In addition, when an invalid user name, password, or URL is specified, then an exception will be thrown by IAppIntSession::Login.
Sample
The following is a fragment from the complete example for the ISilentSessionLogin interface.
   ...
   // Instantiate a BaseServerUrl Component
IBaseServerUrlPtr spIBaseServerURL;
HRESULT hResult = spIBaseServerURL.CreateInstance(__uuidof(BaseServerUrl));
if (FAILED(hResult)) { std::cout << "Could not create the BaseServerURL component." << std::endl; _ASSERTE(0); }
try {
// Initialize the BaseServerURL // with the Application Engine server name, port number, // client application name, and indicate if secure HTTP.
_bstr_t serverName(_T("eraser"));
_bstr_t portNumber(_T("8080"));
_bstr_t applicationName(_T("Workplace"));
VARIANT_BOOL bIsSecure = VARIANT_FALSE; std::cout << "Initializing the BaseServerURL component..." << std::endl;
spIBaseServerURL->Initialize(serverName, portNumber, applicationName, bIsSecure);
... } catch( ... ) { }
// Instantiate the SilentSessionLogin component ISilentSessionLoginPtr spISilentSessionLogin; HRESULT hResult = spISilentSessionLogin.CreateInstance(__uuidof(SilentSessionLogin)); if (FAILED(hResult)) { std::cout << "Could not create the SilentSessionLogin component." << std::endl; _ASSERTE(0); } try { // Initialize the SilentSessionLogin component with the user name and password _bstr_t userName(_T("John Doe")); _bstr_t userPassword(_T("guest")); std::cout << "Initializing the SilentSessionLogin component..." << std::endl; spISilentSessionLogin->InitializeWithCredentials(userName, userPassword, spIBaseServerURL); ... } catch( ... ) { }