Exemple #1
0
 // Creates application request for getting a file
 private static XElement GetFileApplicationRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, string fileReference, string fileType, string targetId, Status status, Dictionary <string, XNamespace> namespaces)
 {
     return(new XElement(namespaces["bxd"] + "ApplicationRequest",
                         new XElement(namespaces["bxd"] + "CustomerId", customerId),
                         new XElement(namespaces["bxd"] + "Command", "DownloadFile"),
                         new XElement(namespaces["bxd"] + "Timestamp", timestamp),
                         new XElement(namespaces["bxd"] + "Status", status.ToString()),
                         new XElement(namespaces["bxd"] + "Environment", environment.ToString()),
                         new XElement(namespaces["bxd"] + "FileReferences",
                                      new XElement(namespaces["bxd"] + "FileReference", fileReference)),
                         new XElement(namespaces["bxd"] + "TargetId", targetId),
                         new XElement(namespaces["bxd"] + "Compression", true),
                         new XElement(namespaces["bxd"] + "SoftwareId", softwareId), // Hard coded in MessageService.cs to FRENDS
                         new XElement(namespaces["bxd"] + "FileType", fileType)));
 }
Exemple #2
0
        // Creates application request for getting a list of available files
        private static XElement GetFileListApplicationRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, string fileType, string targetId, DateTime?startDate, DateTime?endDate, Status status, Dictionary <string, XNamespace> namespaces)
        {
            var properties = new List <XElement>
            {
                new XElement(namespaces["bxd"] + "CustomerId", customerId),
                new XElement(namespaces["bxd"] + "Command", "DownloadFileList"),
                new XElement(namespaces["bxd"] + "Timestamp", timestamp),
                startDate.HasValue ? new XElement(namespaces["bxd"] + "StartDate", startDate.Value.ToString("yyyy-MM-dd")) : null,
                endDate.HasValue ? new XElement(namespaces["bxd"] + "EndDate", endDate.Value.ToString("yyyy-MM-dd")) : null,
                new XElement(namespaces["bxd"] + "Status", status.ToString()),
                new XElement(namespaces["bxd"] + "Environment", environment.ToString()),
                new XElement(namespaces["bxd"] + "TargetId", targetId),
                new XElement(namespaces["bxd"] + "SoftwareId", softwareId), // Hard coded in MessageService.cs to FRENDS
                new XElement(namespaces["bxd"] + "FileType", fileType)
            };

            return(new XElement(namespaces["bxd"] + "ApplicationRequest", properties.Where(p => p != null)));
        }