// This has not yet been implemented public static string GetCertificatesMessage(string customerId, Environment environment, int requestId, string transferKey) { var timestamp = DateTime.Now; var soapBodyContent = Helper.GetCertificatesRequest( customerId: customerId, timestamp: timestamp, environment: environment, softwareId: SoftwareId, requestId: requestId, namespaces: FewNamespaces, transferKey: transferKey); var soapRequestDocument = Helper.GetEmptySoapEnvelope(soapBodyContent, timestamp, FewNamespaces); return(soapRequestDocument.OuterXml); }
public static string GetDownloadFileMessage(X509Certificate2 certificate, string customerId, Environment environment, int requestId, string fileReference) { var timestamp = DateTime.Now; var soapBodyContent = Helper.GetDownloadFileRequest( customerId: customerId, timestamp: timestamp, environment: environment, softwareId: SoftwareId, requestId: requestId, fileReference: fileReference, certificate: certificate, namespaces: Namespaces); var soapRequestDocument = Helper.GetSoapRequestXmlDocument(certificate, soapBodyContent, timestamp, Namespaces); return(soapRequestDocument.OuterXml); }
public static string GetDownloadFileListMessage(X509Certificate2 certificate, string customerId, string fileType, DateTime?startDate, DateTime?endDate, Status status, Environment environment, int requestId) { var timestamp = DateTime.Now; var soapBodyContent = Helper.GetDownloadFileListRequest( customerId: customerId, timestamp: timestamp, fileType: fileType, startDate: startDate, endDate: endDate, status: status, environment: environment, softwareId: SoftwareId, requestId: requestId, certificate: certificate, namespaces: Namespaces); var soapRequestDocument = Helper.GetSoapRequestXmlDocument(certificate, soapBodyContent, timestamp, Namespaces); return(soapRequestDocument.OuterXml); }
// Creates application request for deleting a file private static XElement GetDeleteFileApplicationRequest(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"] + "SoftwareId", softwareId))); }
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)); }
// 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))); }
public static XElement GetCertificateRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, int requestId, Dictionary <string, XNamespace> namespaces, string transferKey, string pkcs10) { var applicationRequest = GetCertificateApplicationRequest(customerId, timestamp, environment, softwareId, namespaces, transferKey, pkcs10); var requestBase64 = GetBase64String(applicationRequest.ToString()); var requestHeader = GetSimpleRequestHeader(namespaces["opc"], customerId, requestId, timestamp); return(new XElement(namespaces["opc"] + "getCertificatein", requestHeader, new XElement(namespaces["opc"] + "ApplicationRequest", requestBase64))); }
// Builds SOAP request body for uploading a file public static XElement GetUploadFileRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, int requestId, X509Certificate2 certificate, Dictionary <string, XNamespace> namespaces, string fileInput, string fileType, Encoding fileEncoding) { var applicationRequest = GetUploadFileApplicationRequest(customerId, timestamp, environment, softwareId, namespaces, fileInput, fileType, fileEncoding); var requestBase64 = SignApplicationRequestAndReturnAsBase64(applicationRequest, certificate); var requestHeader = GetRequestHeader(customerId, requestId, timestamp, softwareId, namespaces); return(new XElement(namespaces["cor"] + "uploadFilein", requestHeader, new XElement(namespaces["mod"] + "ApplicationRequest", requestBase64))); }
// Builds SOAP request body for getting user info public static XElement GetUserInfoRequest(string customerId, DateTime timestamp, Environment environment, string softwareId, int requestId, X509Certificate2 certificate, Dictionary <string, XNamespace> namespaces) { var applicationRequest = GetUserInfoApplicationRequest(customerId, timestamp, environment, softwareId, namespaces); var requestBase64 = SignApplicationRequestAndReturnAsBase64(applicationRequest, certificate); var requestHeader = GetRequestHeader(customerId, requestId, timestamp, softwareId, namespaces); return(new XElement(namespaces["cor"] + "getUserInfoin", requestHeader, new XElement(namespaces["mod"] + "ApplicationRequest", requestBase64))); }
// Builds SOAP request body for getting a list of available files public static XElement GetDownloadFileListRequest(string customerId, DateTime timestamp, string fileType, DateTime?startDate, DateTime?endDate, Status status, Environment environment, string softwareId, int requestId, X509Certificate2 certificate, Dictionary <string, XNamespace> namespaces) { var applicationRequest = GetFileListApplicationRequest(customerId, timestamp, environment, softwareId, fileType, startDate, endDate, status, namespaces); var requestBase64 = SignApplicationRequestAndReturnAsBase64(applicationRequest, certificate); var requestHeader = GetRequestHeader(customerId, requestId, timestamp, softwareId, namespaces); return(new XElement(namespaces["cor"] + "downloadFileListin", requestHeader, new XElement(namespaces["mod"] + "ApplicationRequest", requestBase64))); }
// 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))); }