public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
{
VirtualStream inboundStream = new VirtualStream(pInMsg.BodyPart.GetOriginalDataStream());
VirtualStream outboundStream = new VirtualStream(VirtualStream.MemoryFlag.AutoOverFlowToDisk);
{
VirtualStream inboundStream = new VirtualStream(pInMsg.BodyPart.GetOriginalDataStream());
VirtualStream outboundStream = new VirtualStream(VirtualStream.MemoryFlag.AutoOverFlowToDisk);
string sBatchName = Path.GetFileNameWithoutExtension(pInMsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties").ToString());
AccountingEntriesExcelCreator ExcelCreator = new AccountingEntriesExcelCreator();
outboundStream = ExcelCreator.CreateExcel(inboundStream, sBatchName);
if (outboundStream != null)
{
if (outboundStream.Length > 0)
{
outboundStream.Position = 0;
pInMsg.BodyPart.Data = outboundStream;
outboundStream = ExcelCreator.CreateExcel(inboundStream, sBatchName);
if (outboundStream != null)
{
if (outboundStream.Length > 0)
{
outboundStream.Position = 0;
pInMsg.BodyPart.Data = outboundStream;
pContext.ResourceTracker.AddResource(inboundStream);
pContext.ResourceTracker.AddResource(outboundStream);
}
else
{
pInMsg = null;
}
}
else
{
pInMsg = null;
}
return pInMsg;
}
pContext.ResourceTracker.AddResource(outboundStream);
}
else
{
pInMsg = null;
}
}
else
{
pInMsg = null;
}
return pInMsg;
}
Comments
Post a Comment