private static void GetAuthenticatedUserManagementService(UserManagement userManagement)
 {
     userManagement.Url = "https://stage1.sumtotalsystems.com/southerncostage82ws/services/usermanagement.asmx"; // ConfigurationManager.AppSettings["SumTotalWebSeviceUserManagement"];
     userManagement.UserSecurityContextValue = new UserManagementProxy.UserSecurityContext();
     userManagement.UserSecurityContextValue.Token = new UserManagementProxy.UserToken();
     userManagement.UserSecurityContextValue.Token.Value = SumTotalApplicationAuthentication.GetSumTotalApplicationUserToken();
 }
        public UserManagementProxy.User GetUser(string userId, int populationLevel)
        {
            try
            {
                UserManagement userManagementService = new UserManagement();
                GetAuthenticatedUserManagementService(userManagementService);

                return userManagementService.GetUserById("1", 1);
            }
            catch (Exception ex)
            {
                Log.Write(ex, Log.Mask.Failure);
                throw;
            }
        }
        public List<UserManagementProxy.User> GetUsers(string searchFilter, int populationLevel)
        {
            try
            {
                UserManagement userManagementService = new UserManagement();
                GetAuthenticatedUserManagementService(userManagementService);

                UserManagementProxy.User[] userProxyList;
                userProxyList = userManagementService.GetUsers(Constants.SUMTOTAL_DOMAIN_ID, searchFilter, populationLevel);
                return userProxyList.ToList();
            }
            catch (Exception ex)
            {
                Log.Write(ex, Log.Mask.Failure);
                throw;
            }
        }