Beispiel #1
0
 // Creates application request for fetching user info
 private static XElement GetUserInfoApplicationRequest(string customerId, string targetId, DateTime timestamp, Environment environment, string softwareId, Dictionary <string, XNamespace> namespaces)
 {
     return(new XElement(namespaces["bxd"] + "ApplicationRequest",
                         new XElement(namespaces["bxd"] + "CustomerId", customerId),
                         new XElement(namespaces["bxd"] + "Command", "GetUserInfo"),
                         new XElement(namespaces["bxd"] + "Timestamp", timestamp),
                         new XElement(namespaces["bxd"] + "Environment", environment.ToString()),
                         !String.IsNullOrEmpty(targetId) ? new XElement(namespaces["bxd"] + "TargetId", targetId) : null,
                         new XElement(namespaces["bxd"] + "SoftwareId", softwareId))); // Hard coded in MessageService.cs to FRENDS
 }
Beispiel #2
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)));
 }
Beispiel #3
0
        private static XElement GetCertificateApplicationRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, Dictionary <string, XNamespace> namespaces, string transferKey, string pkcs10 = null)
        {
            var properties = new List <XElement>
            {
                new XElement(namespaces["bxd"] + "CustomerId", customerId),
                new XElement(namespaces["bxd"] + "Timestamp", timestamp),
                new XElement(namespaces["bxd"] + "Environment", environment.ToString()),
                new XElement(namespaces["bxd"] + "SoftwareId", softwareId),
                new XElement(namespaces["bxd"] + "Service", "MATU"),
                string.IsNullOrEmpty(pkcs10) ? null : new XElement(namespaces["bxd"] + "Content", pkcs10),
                new XElement(namespaces["bxd"] + "TransferKey", transferKey)
            }.Where(p => p != null);

            return(new XElement(namespaces["bxd"] + "CertApplicationRequest", properties));
        }
Beispiel #4
0
        // Creates application request for uploading a file
        private static XElement GetUploadFileApplicationRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, Dictionary <string, XNamespace> namespaces, string fileInput, string fileType, Encoding fileEncoding, string targetId)
        {
            var compressedFile = GzipAndBase64Encode(fileInput, fileEncoding);

            return(new XElement(namespaces["bxd"] + "ApplicationRequest",
                                new XElement(namespaces["bxd"] + "CustomerId", customerId),
                                new XElement(namespaces["bxd"] + "Command", "UploadFile"),
                                new XElement(namespaces["bxd"] + "Timestamp", timestamp),
                                new XElement(namespaces["bxd"] + "Environment", environment.ToString()),
                                new XElement(namespaces["bxd"] + "TargetId", targetId),
                                new XElement(namespaces["bxd"] + "Compression", true),         // This needs to be true since the content is compressed with Gzip
                                new XElement(namespaces["bxd"] + "CompressionMethod", "GZIP"), // Needs to be given, since also PKZIP is supported
                                new XElement(namespaces["bxd"] + "SoftwareId", softwareId),    // Hard coded in MessageService.cs to FRENDS
                                new XElement(namespaces["bxd"] + "FileType", fileType),
                                new XElement(namespaces["bxd"] + "Content", compressedFile)));
        }
Beispiel #5
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)));
        }