public void Logout() { if (_boSession != null) { _boSession.Logout(); _boSession = null; _boReportEngine = null; _boBiPlatform = null; _boSessionId = null; } }
public ExitCode Login(string cmsname, string username, string password, string authType, bool toBIPlatform, bool toReportEngine) { //Login if (base.cancel) { return(ExitCode.CANCELED); } base.Log("Login to " + base.SessionURL); try{ EnterpriseCredential boEnterpriseCredential = new EnterpriseCredential(); boEnterpriseCredential.Domain = cmsname; boEnterpriseCredential.Login = username; boEnterpriseCredential.Password = password; boEnterpriseCredential.AuthType = authType; this.boSessionInfo = boSession.Login(boEnterpriseCredential); this.SessionId = this.boSessionInfo.SessionID; }catch (Exception ex) { // this.boSession.Dispose(); this.boSession = null; throw CustomException("Failed to Login", ex); } if (base.cancel) { return(ExitCode.CANCELED); } if (toBIPlatform) { //Get the BIPlatform service base.Log("Connect to BIPlatform service"); try{ foreach (WSResource ressource in boSessionInfo.WSResourceList) { if (ressource.WSType == "BIPlatform") { this.boConnection.URL = ressource.URL; this.boBIPlatform = new BIPlatform(boConnection, boSession.ConnectionState); break; } } if (this.boBIPlatform == null) { throw new Exception("Service not available ! "); } }catch (Exception ex) { this.Logout(); throw CustomException("Failed to access to the BIPlatform service : \r\n", ex); } } if (base.cancel) { return(ExitCode.CANCELED); } return(ExitCode.SUCCEED); }
public void ConnectToBIPlatform() { foreach (WSResource ressource in _boSessionInfo.WSResourceList) { if (ressource.WSType == "BIPlatform") { _boConnection.URL = ressource.URL; _boBiPlatform = new BIPlatform(_boConnection, _boSession.ConnectionState); break; } } if (_boBiPlatform == null) { throw new Exception("BIPlatform service is not available!"); } }
public ExitCode Logout() { base.Log("Logout web service"); try{ if (this.boSession != null) { this.boSession.Logout(); this.boSession = null; } this.boBIPlatform = null; this.SessionId = null; return(ExitCode.SUCCEED); }catch (Exception) { return(ExitCode.FAILED); } }