Esempio n. 1
0
        public ApplicationSessionsTO getMdwsSessionsInMemory()
        {
            ApplicationSessionsTO result = new ApplicationSessionsTO();

            if (Application == null || Application.AllKeys == null || !Application.AllKeys.Contains("APPLICATION_SESSIONS"))
            {
                return(result);
            }
            ApplicationSessions sessions = (ApplicationSessions)Application["APPLICATION_SESSIONS"];

            if (sessions.Sessions == null || sessions.Sessions.Count == 0)
            {
                return(result);
            }

            result.sessions = new ApplicationSessionTO[sessions.Sessions.Count];
            int currentIndex = 0;

            foreach (string sessionId in sessions.Sessions.Keys)
            {
                result.sessions[currentIndex] = new ApplicationSessionTO(sessions.Sessions[sessionId]);
                currentIndex++;
            }
            return(result);
        }
Esempio n. 2
0
        public BaseService()
        {
            // If not Http request has been made yet Session is null
            // This happens before the Startup page is displayed
            if (HttpContext.Current.Session == null)
            {
                return;
            }

            // At this point a request has been made to a web service page
            if (HttpContext.Current.Session["MySession"] == null)
            {
                MySession = new MySession(this.GetType().Name);
                ApplicationSessions sessions = (ApplicationSessions)Application["APPLICATION_SESSIONS"];
                Application.Lock();
                sessions.ConfigurationSettings = MySession.MdwsConfiguration;
                Application.UnLock();
            }
        }
 public ApplicationSessionsTO(ApplicationSessions sessions)
 {
     if (sessions != null)
     {
         setSessions(sessions.Sessions);
     }
 }