コード例 #1
0
 // Creates application request for fetching user info
 private static XElement GetUserInfoApplicationRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, Dictionary <string, XNamespace> namespaces)
 {
     return(new XElement(namespaces["dat"] + "ApplicationRequest",
                         new XElement(namespaces["dat"] + "CustomerId", customerId),
                         new XElement(namespaces["dat"] + "Timestamp", timestamp),
                         new XElement(namespaces["dat"] + "Environment", environment.ToString()),
                         new XElement(namespaces["dat"] + "SoftwareId", softwareId)));
 }
コード例 #2
0
 // Creates application request for getting a file
 private static XElement GetFileApplicationRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, string fileReference, Dictionary <string, XNamespace> namespaces)
 {
     return(new XElement(namespaces["dat"] + "ApplicationRequest",
                         new XElement(namespaces["dat"] + "CustomerId", customerId),
                         new XElement(namespaces["dat"] + "Timestamp", timestamp),
                         new XElement(namespaces["dat"] + "Environment", environment.ToString()),
                         new XElement(namespaces["dat"] + "FileReferences",
                                      new XElement(namespaces["dat"] + "FileReference", fileReference)),
                         new XElement(namespaces["dat"] + "Compression", true),
                         new XElement(namespaces["dat"] + "SoftwareId", softwareId)));
 }
コード例 #3
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)
        {
            var compressedFile = GzipAndBase64Encode(fileInput, fileEncoding);

            return(new XElement(namespaces["dat"] + "ApplicationRequest",
                                new XElement(namespaces["dat"] + "CustomerId", customerId),
                                new XElement(namespaces["dat"] + "Timestamp", timestamp),
                                new XElement(namespaces["dat"] + "Environment", environment.ToString()),
                                new XElement(namespaces["dat"] + "TargetId", "TARGET"), // this needs to hardcoded to this value
                                new XElement(namespaces["dat"] + "Compression", true),  // this needs to be true since the content is compressed with Gzip
                                new XElement(namespaces["dat"] + "SoftwareId", softwareId),
                                new XElement(namespaces["dat"] + "FileType", fileType),
                                new XElement(namespaces["dat"] + "Content", compressedFile)));
        }
コード例 #4
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["dat"] + "CustomerId", customerId),
                new XElement(namespaces["dat"] + "Timestamp", timestamp),
                new XElement(namespaces["dat"] + "Environment", environment.ToString()),
                new XElement(namespaces["dat"] + "SoftwareId", softwareId),
                new XElement(namespaces["dat"] + "Service", "MATU"),
                string.IsNullOrEmpty(pkcs10) ? null : new XElement(namespaces["dat"] + "Content", pkcs10),
                new XElement(namespaces["dat"] + "TransferKey", transferKey)
            }.Where(p => p != null);

            return(new XElement(namespaces["dat"] + "CertApplicationRequest", properties));
        }
コード例 #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, DateTime?startDate, DateTime?endDate, Status status, Dictionary <string, XNamespace> namespaces)
        {
            var properties = new List <XElement>
            {
                new XElement(namespaces["dat"] + "CustomerId", customerId),
                new XElement(namespaces["dat"] + "Timestamp", timestamp),
                startDate.HasValue ? new XElement(namespaces["dat"] + "StartDate", startDate.Value.ToString("yyyy-MM-dd")) : null,
                endDate.HasValue ? new XElement(namespaces["dat"] + "EndDate", endDate.Value.ToString("yyyy-MM-dd")) : null,
                new XElement(namespaces["dat"] + "Status", status.ToString()),
                new XElement(namespaces["dat"] + "Environment", environment.ToString()),
                new XElement(namespaces["dat"] + "SoftwareId", softwareId),
                !string.IsNullOrEmpty(fileType) ? new XElement(namespaces["dat"] + "FileType", fileType) : null
            };

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