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);
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.... // 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( ... ) { }