Esempio n. 1
0
        public bool EndApplicationSession(Guid applicationKey, Int64 applicationSessionId, DateTime lastActivity, DateTime endTime)
        {
            AuthHeaderValidation.CreateSoapHeaderLog("EndApplicationSession", Credentials.ToolId, Credentials.ApplicationKey, null, null, 10, null);

            WebServiceDAL.UpdateApplicationsSession(applicationKey, applicationSessionId, lastActivity, endTime);

            return(true);
        }
Esempio n. 2
0
        public Guid?RegisterApplication(Guid toolId, string computerName)
        {
            //AuthHeaderValidation.CreateSoapHeaderLog("RegisterApplication", toolId, null, null, null, 10, null);

            Guid?applicationKey = WebServiceDAL.GetNewApplicationKey(toolId, computerName);

            AuthHeaderValidation.CreateSoapHeaderLog("RegisterApplication", toolId, applicationKey, null, null, 10, null);

            return(applicationKey);
        }
Esempio n. 3
0
        private Guid AuthenticateClient(string action)
        {
            Guid?userId = AuthHeaderValidation.Validate(action, Credentials);

            if (!userId.HasValue)
            {
                throw new SoapException("Unauthorized", SoapException.ClientFaultCode);
            }
            else
            {
                return(userId.Value);
            }
        }
Esempio n. 4
0
        public bool CreateApplicationExceptionLog(Guid applicationKey, Guid toolId, string type, string description, string message, string stack, string innerExceptionMessage)
        {
            try
            {
                try
                {
                    if (!string.IsNullOrEmpty(stack))
                    {
                        stack = Encryption.DecryptString(stack);
                    }
                }
                catch { }

                if (Credentials != null && !string.IsNullOrEmpty(Credentials.Username) && !string.IsNullOrEmpty(Credentials.Password))
                {
                    try
                    {
                        Guid userId = AuthenticateClient("CreateApplicationExceptionLog");
                        return(WebServiceDAL.InsertApplicationsExceptionLog(applicationKey, toolId, userId, type, description, message, stack, innerExceptionMessage));
                    }
                    catch (Exception ex)
                    {
                        WebServiceDAL.StoreException("Webservice", "CreateApplicationExceptionLog Inside 1st Try/Catch", ex);
                        AuthHeaderValidation.CreateSoapHeaderLog("CreateApplicationExceptionLog", toolId, applicationKey, null, null, 10, null);
                        return(WebServiceDAL.InsertApplicationsExceptionLog(applicationKey, toolId, null, type, description, message, stack, innerExceptionMessage));
                    }
                }
                else
                {
                    AuthHeaderValidation.CreateSoapHeaderLog("CreateApplicationExceptionLog", toolId, applicationKey, null, null, 10, null);
                    return(WebServiceDAL.InsertApplicationsExceptionLog(applicationKey, toolId, null, type, description, message, stack, innerExceptionMessage));
                }
            }
            catch (Exception ex)
            {
                // Log it
                WebServiceDAL.StoreException("Webservice", "CreateApplicationExceptionLog", ex);
                return(false);
            }
        }
Esempio n. 5
0
 public Int64 StartApplicationSession(Guid applicationKey, Guid toolId, string toolVersion, string computerName)
 {
     try
     {
         if (Credentials != null && !string.IsNullOrEmpty(Credentials.Username) && !string.IsNullOrEmpty(Credentials.Password))
         {
             Guid userId = AuthenticateClient("StartApplicationSession");
             return(WebServiceDAL.ReCreateApplicationsSession(applicationKey, toolId, toolVersion, userId, computerName, DateTime.UtcNow, DateTime.UtcNow, null));
         }
         else
         {
             AuthHeaderValidation.CreateSoapHeaderLog("StartApplicationSession", toolId, applicationKey, null, null, 10, null);
             return(WebServiceDAL.CreateApplicationsSession(applicationKey, toolId, toolVersion, computerName, DateTime.UtcNow, DateTime.UtcNow, null));
         }
     }
     catch (Exception ex)
     {
         // Log it
         WebServiceDAL.StoreException("Webservice", "StartApplicationSession", ex);
         return(0);
     }
 }