streamIO.write(xmlDoc);
XX_VendPaymIntegrationHelper::uploadToBlob(parameters.BlobStorageConnectionString,
parameters.BlobStorageContainer,
parameters.BlobStorageOutboundFolder,
fileName,
streamIO,xmlDoc);
public static void uploadToBlob(HS_VendPaymIntBlobStorageConnectionString _connectionString,
HS_VendPaymIntBlobStorageContainer _container,
HS_VendPaymBlobStorageOutboundFolder _folder,
Filename _filename,
CommaTextStreamIo _streamIO, XMLDocument _xmlDoc )
{
try
{
CloudStorageAccount storageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount::Parse(_connectionString);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer blobContainer = blobClient.GetContainerReference(_container);
//blobContainer.CreateIfNotExists(null, null); //create blob container
Filename fullName = _folder ? _folder + "/" + _filename : _filename;
CloudBlockBlob destBlob = blobContainer.GetBlockBlobReference(fullName);
System.IO.MemoryStream memstream = _streamIO.getstream();
destBlob.UploadFromStream(memstream, null, null, null);
}
catch
{
throw error("Blob error");
}
}