Exemplo n.º 1
0
 private void openService()
 {
     try
     {
         _service = new SferaServiceClient("SferaServiceCompact");
         var sc = new SymmetricCryptography<TripleDESCryptoServiceProvider>(Login.Instance.Key, Login.Instance.IV);
         if (_service.ClientCredentials != null)
         {
             _service.ClientCredentials.UserName.UserName = sc.Encrypt(Login.Instance.CurrentLogin().LoginName + "&" + Login.Instance.CurrentLogin().CodiceAzienda);
             _service.ClientCredentials.UserName.Password = sc.Encrypt(Login.Instance.CurrentLogin().Password);
         }
         _service.Open();
     }
     catch (Exception ex)
     {
         _log.FatalFormat("Errore nell'apertura del servizio - {0}", ex, Gipasoft.Library.Utility.GetMethodDescription());
         throw;
     }
 }
Exemplo n.º 2
0
 private void openService()
 {
     _service = new SferaServiceClient("SferaServiceCompact");
     Gipasoft.Security.SymmetricCryptography<TripleDESCryptoServiceProvider> sc = new Gipasoft.Security.SymmetricCryptography<TripleDESCryptoServiceProvider>(Gipasoft.Security.Login.Instance.Key, Gipasoft.Security.Login.Instance.IV);
     _service.ClientCredentials.UserName.UserName = sc.Encrypt("giorgio&zeth");
     _service.ClientCredentials.UserName.Password = sc.Encrypt("gipasoft");
     _service.Open();
 }
Exemplo n.º 3
0
        private SferaServiceClient getServiceClient()
        {
            if (_client == null)
            {
                _client = new SferaServiceClient("SferaServiceCompact");
                if (_client.ClientCredentials != null)
                {
                    _client.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["LoginUser"];
                    _client.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["LoginPwd"];
                }
            }

            if (_client.State != CommunicationState.Opened)
            {
                _client = new SferaServiceClient("SferaServiceCompact");
                if (_client.ClientCredentials != null)
                {
                    _client.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["LoginUser"];
                    _client.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["LoginPwd"];
                }
                _client.Open();
                while (_client.State != CommunicationState.Opened)
                {
                    var x = string.Empty;
                }
            }

            return _client;
        }