/// <summary>Subscribe to one or many notification Service.</summary> /// <param name="pServiceId">Service ID of the information needed.</param> private void SubscribeToServiceNotifications(eServiceID serviceId) { LogManager.WriteLog( TraceType.INFO, "Subscribing to serviceId=" + serviceId, "PIS.Ground.Core.T2G.LocalDataStorage.SubscribeToServiceNotifications", null, EventIdEnum.GroundCore); try { using (PIS.Ground.Core.T2G.WebServices.VehicleInfo.VehicleInfoPortTypeClient objVehicleInfo = new VehicleInfoPortTypeClient()) { objVehicleInfo.subscribeToServiceNotifications(_sessionData.SessionId, new systemIdList(), (int)serviceId); } } catch (Exception ex) { LogManager.WriteLog(TraceType.WARNING, ex.Message, "PIS.Ground.Core.T2G.T2GClient.SubscribeToServiceNotifications", ex, EventIdEnum.GroundCore); } }
/// <summary>Subscribe to message notifications.</summary> /// <param name="messageId">Identifier for the message.</param> private void SubscribeToMessageNotifications(string messageId) { LogManager.WriteLog( TraceType.INFO, "SubscribeToMessageNotifications: System=ALL, Message=" + messageId, "PIS.Ground.Core.T2G.T2GClient.SubscribeToMessageNotifications", null, EventIdEnum.GroundCore); try { messageSubscriptionList messageSubscriptions = new messageSubscriptionList(); messageSubscriptions.Add( new messageSubscriptionStruct { messageId = messageId, notificationMode = notificationModeEnum.onChanges, notifyFreq = 0 }); using (PIS.Ground.Core.T2G.WebServices.VehicleInfo.VehicleInfoPortTypeClient objVehicleInfo = new VehicleInfoPortTypeClient()) { objVehicleInfo.subscribeToMessageNotifications( _sessionData.SessionId, new systemIdList(), messageSubscriptions); } } catch (Exception ex) { LogManager.WriteLog(TraceType.WARNING, ex.Message, "PIS.Ground.Core.T2G.LocalDataStorage.SubscribeToMessageNotifications", ex, EventIdEnum.GroundCore); } }