コード例 #1
0
        /// <summary>
        /// Servizio di logout
        /// </summary>
        /// <param name="request"></param>
        /// <returns>Response</returns>
        public Services.Authentication.LogOut.LogOutResponse LogOut(Services.Authentication.LogOut.LogOutRequest request)
        {
            logger.Info("BEGIN");
            Services.Authentication.LogOut.LogOutResponse response = Manager.AuthenticationManager.LogOut(request);

            Utils.CheckFaultException(response);
            logger.Info("END");
            return(response);
        }
コード例 #2
0
        public static Services.Authentication.LogOut.LogOutResponse LogOut(Services.Authentication.LogOut.LogOutRequest request)
        {
            Services.Authentication.LogOut.LogOutResponse response = new Services.Authentication.LogOut.LogOutResponse();

            try
            {
                DocsPaVO.utente.Utente     utente     = null;
                DocsPaVO.utente.InfoUtente infoUtente = null;

                //Inizio controllo autenticazione utente
                infoUtente = Utils.CheckAuthentication(request, "LogOut");

                utente = BusinessLogic.Utenti.UserManager.getUtenteById(infoUtente.idPeople);
                if (utente == null)
                {
                    //Utente non trovato
                    throw new PisException("USER_NO_EXIST");
                }
                //Fine controllo autenticazione utente

                BusinessLogic.Utenti.Login.logoff(utente.userId, utente.idAmministrazione, utente.dst);

                response.Success = true;
            }
            catch (PisException pisEx)
            {
                logger.ErrorFormat("PISException: {0}, {1}", pisEx.ErrorCode, pisEx.Description);
                response.Error = new Services.ResponseError
                {
                    Code        = pisEx.ErrorCode,
                    Description = pisEx.Description
                };

                response.Success = false;
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("Eccezione Generica: APPLICATION_ERROR, {0}", ex.Message);
                response.Error = new Services.ResponseError
                {
                    Code        = "APPLICATION_ERROR",
                    Description = ex.Message
                };

                response.Success = false;
            }

            return(response);
        }