Exemplo n.º 1
0
 /// <summary>Enables the system notifications.</summary>
 /// <param name="pEnable">True to enable, false to disable.</param>
 private void EnableSystemNotifications(bool pEnable)
 {
     try
     {
         using (PIS.Ground.Core.T2G.WebServices.Identification.IdentificationPortTypeClient objIdentification = new IdentificationPortTypeClient())
         {
             objIdentification.enableSystemNotifications(_sessionData.SessionId, pEnable);
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(TraceType.ERROR, ex.Message, "Ground.Core.T2G.LocalDataStorage.EnableSystemNotifications", ex, EventIdEnum.GroundCore);
     }
 }
        /// <summary>Send a session-keep-alive message to T2G server.</summary>
        private void SessionKeepAlive()
        {
            LogManager.WriteLog(TraceType.INFO, "SessionKeepAlive", "PIS.Ground.Core.T2G.T2GConnectionManager", null, EventIdEnum.GroundCore);

            using (PIS.Ground.Core.T2G.WebServices.Identification.IdentificationPortTypeClient objIdentification = new IdentificationPortTypeClient())
            {
                objIdentification.keepAliveSession(_sessionData.SessionId, SessionKeepAliveMillis / 1000);
            }
        }
Exemplo n.º 3
0
        /// <summary>To get all known T2G systems.</summary>
        private void InitializeSystemList()
        {
            try
            {
                LogManager.WriteLog(TraceType.INFO, "Getting system list...", "PIS.Ground.Core.T2G.LocalDataStorage.GetSystemList", null, EventIdEnum.GroundCore);

                using (PIS.Ground.Core.T2G.WebServices.Identification.IdentificationPortTypeClient objIdentification = new IdentificationPortTypeClient())
                {
                    systemList lSystemStructList = objIdentification.enumSystems(_sessionData.SessionId);

                    List <SystemInfo> lSystemList;
                    if (T2GDataConverter.BuildSystemList(lSystemStructList, out lSystemList))
                    {
                        // Construct the current system list from the returned data
                        UpdateSystemList(lSystemList);
                    }

                    SubscribeToMessageNotifications();
                    SubscribeToServiceNotifications();
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(TraceType.ERROR, ex.Message, "PIS.Ground.Core.T2G.T2GClient.GetSystemList", ex, EventIdEnum.GroundCore);
            }
        }
        /// <summary>Method is used to call the T2G Service to login</summary>
        /// <returns>T2G session ID</returns>
        private int SessionInitialize()
        {
            LogManager.WriteLog(TraceType.INFO, "SessionInitialize", "PIS.Ground.Core.T2G.T2GConnectionManager", null, EventIdEnum.GroundCore);

            int intSessionID = 0;

            applicationIdList objapplicationIdList = new applicationIdList();

            if (!string.IsNullOrEmpty(ServiceConfiguration.T2GApplicationId))
            {
                objapplicationIdList.Add(ServiceConfiguration.T2GApplicationId);
            }

            using (PIS.Ground.Core.T2G.WebServices.Identification.IdentificationPortTypeClient objIdentification = new IdentificationPortTypeClient())
            {
                int effectiveProtoc = 0;

                // Change protocol from version 1 to another to get deleted element notification.
                // Else, T2G will only send element changed, even on deletion.

                intSessionID = objIdentification.login(
                    ServiceConfiguration.T2GServiceUserName,
                    ServiceConfiguration.T2GServicePwd,
                    ServiceConfiguration.T2GServiceNotificationUrl,
                    objapplicationIdList,
                    T2GProtocolVersion, out effectiveProtoc);
            }

            if (intSessionID == 0)
            {
                throw new T2GLoginFailureException();
            }

            return(intSessionID);
        }