/// <summary> /// Notifies by calling a CPR Notification web service /// </summary> /// <param name="notification"></param> public override void Notify(Data.EventNotification notification) { NotificationService.Notification notificationService = new NotificationService.Notification(); notificationService.Url = DatabaseObject.Url; notificationService.Credentials = System.Net.CredentialCache.DefaultCredentials; var wsdlNotif = notification.ToWsdl(); notificationService.Notify(wsdlNotif); }
/// <summary> /// Notifies by serializing the notification into an XML file /// </summary> /// <param name="notification"></param> public override void Notify(Data.EventNotification notification) { string folder = DatabaseObject.Url; if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } var oioNotif = notification.ToOioNotification(); System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(oioNotif.GetType()); string filePath = Strings.NewUniquePath(folder, "xml"); System.IO.StreamWriter w = new System.IO.StreamWriter(filePath); serializer.Serialize(w, oioNotif); w.Close(); }
/// <summary> /// Send the supplied notification through the channel /// </summary> /// <param name="notification"></param> public abstract void Notify(Data.EventNotification notification);