public static DocsPaWR.InfoUtente getInfoUtente(DocsPaWR.Utente utente, DocsPaWR.Ruolo ruolo) { DocsPaWR.InfoUtente infoUtente = new ConservazioneWA.DocsPaWR.InfoUtente(); try { if (infoUtente != null && ruolo != null) { infoUtente.idCorrGlobali = ruolo.systemId; infoUtente.idPeople = utente.idPeople; infoUtente.idGruppo = ruolo.idGruppo; infoUtente.dst = utente.dst; infoUtente.idAmministrazione = utente.idAmministrazione; infoUtente.userId = utente.userId; infoUtente.sede = utente.sede; if (utente != null && utente.urlWA != null) { infoUtente.urlWA = utente.urlWA; } } } catch (Exception exception) { System.Diagnostics.Debug.WriteLine("Impossibile accedere alle informazioni dell'utente" + exception.ToString()); infoUtente = null; Debugger.Write("Errore nel get info Utente: " + exception.Message); } return(infoUtente); }
public DocsPaWR.DocsPaWebService getProxyDocsPa() { DocsPaWR.DocsPaWebService wss = new ConservazioneWA.DocsPaWR.DocsPaWebService(); wss.Timeout = 3600000; #region Gestione del timeout di connessione try { int timeOut = Int32.Parse(ConfigurationManager.AppSettings["EXECUTIONTIMEOUT"].ToString()); //int l_timeOutLimit = 3600 * 1000 * 24; if (timeOut > 0) { wss.Timeout = timeOut; } } catch (Exception e) { Debugger.Write("Errore nella gestione del timeout del getProxyDocsPa: " + e.Message); } #endregion #region Gestione del proxy try { string proxy = ConfigurationManager.AppSettings["PROXY"].ToString(); if (string.IsNullOrEmpty(proxy)) { proxy = "0"; } if (proxy.Equals("1")) { string proxyUrl = ConfigurationManager.AppSettings["PROXYURL"].ToString(); if (!proxyUrl.ToLower().StartsWith("http://")) { proxyUrl = "http://" + proxyUrl; } IWebProxy proxyObject = new WebProxy(proxyUrl, true); if (ConfigurationManager.AppSettings["PROXYCREDENTIALS"].ToString().Equals("1")) { string username = ConfigurationManager.AppSettings["PROXYUSERNAME"].ToString(); string password = ConfigurationManager.AppSettings["PROXYPASSWORD"].ToString(); string domain = ConfigurationManager.AppSettings["PROXYDOMAIN"].ToString(); NetworkCredential myCred = new NetworkCredential(username, password, domain); proxyObject.Credentials = myCred; } wss.Proxy = proxyObject; } } catch (Exception e) { Debugger.Write("Errore nella gestione del proxy del getProxyDocsPa: " + e.Message); } #endregion wss.Timeout = System.Threading.Timeout.Infinite; return(wss); }
public static Corrispondente GetCorrispondenteByCodRubricaIE(string codice, AddressbookTipoUtente tipoIE, DocsPaWR.InfoUtente infoUtente) { try { return(wss.AddressbookGetCorrispondenteByCodRubricaIE(codice, tipoIE, infoUtente)); } catch (System.Web.Services.Protocols.SoapException es) { Debugger.Write("Errore nel get corrispondente: " + es.Message); } catch (Exception) { } return(null); }
public static DocsPaWR.ValidationResult ValidateLogin(string userName, string idAmm, string sessionId) { DocsPaWR.ValidationResult result = DocsPaWR.ValidationResult.APPLICATION_ERROR; try { result = wss.ValidateLogin(userName, idAmm, sessionId); } catch (Exception exception) { // DocsPaUtils.LogsManagement.Debugger.Write("Impossibile validare la sessione.", exception); result = DocsPaWR.ValidationResult.APPLICATION_ERROR; Debugger.Write("Errore nel ValidateLogin: " + exception.Message); } return(result); }
public static bool logOff(WSConservazioneLocale.InfoUtente infoUtente, Page page) { string userId = infoUtente.userId; string idAmm = infoUtente.idAmministrazione; string dst = infoUtente.dst; bool result = true; try { result = wss.Logoff(userId, idAmm, page.Session.SessionID, dst); } catch (Exception e) { result = false; Debugger.Write("Errore nel log-off: " + e.Message); } return(result); }
public static DocsPaWR.Utente ForcedLogin(Page page, DocsPaWR.UserLogin login, out DocsPaWR.LoginResult loginResult) { DocsPaWR.Utente utente = null; loginResult = DocsPaWR.LoginResult.OK; string ipaddress; try { loginResult = wss.Login(login, true, page.Session.SessionID, out utente, out ipaddress); } catch (Exception ex) { loginResult = DocsPaWR.LoginResult.APPLICATION_ERROR; utente = null; Debugger.Write("Errore nella ForcedLogin: " + ex.Message); } return(utente); }
//protected static DocsPaWR.DocsPaWebService wss = new DocsPaWR.DocsPaWebService(); public static DocsPaWR.Utente login(Page page, DocsPaWR.UserLogin login, out DocsPaWR.LoginResult loginResult, out string ipaddress) { DocsPaWR.Utente utente = null; loginResult = DocsPaWR.LoginResult.OK; ipaddress = ""; try { loginResult = wss.Login(login, false, page.Session.SessionID, out utente, out ipaddress); } catch (Exception e) { //string msg = "Login Error"; //DocsPaUtils.LogsManagement.Debugger.Write(msg, exception); loginResult = DocsPaWR.LoginResult.APPLICATION_ERROR; utente = null; Debugger.Write("Errore nel login result: " + e.Message); } return(utente); }
public static void logoff(System.Web.SessionState.HttpSessionState session) { ConservazioneWA.DocsPaWR.Utente utente = (ConservazioneWA.DocsPaWR.Utente)session["userData"]; DocsPaWR.Ruolo ruolo = (DocsPaWR.Ruolo)utente.ruoli[0]; DocsPaWR.InfoUtente infoUtente = null; try { if (ruolo != null && utente != null) { infoUtente = getInfoUtente(utente, ruolo); string appConfigValue = ConfigurationManager.AppSettings["DISABLE_LOGOUT_CLOSE_BUTTON"]; //PER ANAS, permette login passando dal portale applicativo. if (appConfigValue == null || (!Convert.ToBoolean(appConfigValue))) { wss.Logoff(utente.userId, utente.idAmministrazione, session.SessionID, infoUtente.dst); } } } catch (Exception ex) { Debugger.Write("Errore nel logoff: " + ex.Message); } }