Ejemplo n.º 1
0
 public ExitCode Login(string cmsname, string username, string password, string authType, bool toBIPlatform, bool toReportEngine)
 {
     //Login
     if (base.cancel)
     {
         return(ExitCode.CANCELED);
     }
     base.SetProgress(4);
     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)
     {
         base.SetProgress(9);
         //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);
 }
Ejemplo n.º 2
0
 public void Logout()
 {
     if (boSession != null)
     {
         boSession.Logout();
         boSession      = null;
         boReportEngine = null;
         boBIPlatform   = null;
         boSessionId    = null;
     }
 }
Ejemplo n.º 3
0
 public ExitCode Logout()
 {
     base.Log("Logout web service");
     base.SetProgress(100);
     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);
     }
 }
Ejemplo n.º 4
0
        public void Login(LoginData credentials)
        {
            boConnection = new Connection(credentials.Url);
            boSession    = new Session_(boConnection);
            if (credentials.Proxy != null && !String.IsNullOrEmpty(credentials.Proxy.Host))
            {
                boConnection.Proxy = credentials.Proxy.ToWebProxy();
            }
            EnterpriseCredential boEnterpriseCredential = new EnterpriseCredential();

            boEnterpriseCredential.Domain   = credentials.Domain;
            boEnterpriseCredential.Login    = credentials.Login;
            boEnterpriseCredential.Password = credentials.Password;
            boEnterpriseCredential.AuthType = credentials.AuthType;
            boSessionInfo = boSession.Login(boEnterpriseCredential);
            boSessionId   = boSessionInfo.SessionID;
        }
Ejemplo n.º 5
0
 public Session140(string sessionURL) : base(sessionURL)
 {
     this.boConnection = new Connection(sessionURL);
     this.boSession    = new Session(this.boConnection);
 }