Re: Execute pipeline in BizTalk Custom Adapter
- From: ahmad.huntash@xxxxxxxxx
- Date: Thu, 23 Aug 2007 09:22:35 -0000
Not sure this is an easy task. Could you describe why you want to do
that? Maybe we can give you another (better) way of doing it...
--
eliasen, representing himself and not the company he works for.
Private blog:http://blog.eliasen.dk
Private email: j...@xxxxxxxxxx
Hi Jan,
i need to create an custom adapter that can be use directly (filtering
with receive port name) or get the message from orchestration's. this
adapter will get an message as flat file (SWIFT FIN File) and use
SWIFTDasm to convert it to XML Schema which i have more than 255
Schema after that i need to get some data from this xml and make new
xml schema to save data to database.
my last code is
internal class SQLTransmitterEndpoint : AsyncTransmitterEndpoint
{
private static IBaseMessageFactory factory;
private static IPipeline pipeline;
private static IPipelineContext pipelineContext;
public override IBaseMessage ProcessMessage(IBaseMessage message)
{
PipelineFactory factory = new PipelineFactory();
pipeline = factory.CreateReceivePipeline();
Stage stage = factory.CreateDisassembleStage(pipeline);
SQLTransmitterEndpoint.pipelineContext = new
PipelineContext();
IInitializePipelineContext pipelineContext =
(IInitializePipelineContext)SQLTransmitterEndpoint.pipelineContext;
IPropertyBag propertyBag = (IPropertyBag)new
BTMPropertyBag();
IBaseComponent component =
factory.CreatePipelineComponent("Microsoft.Solutions.FinancialServices.SWIFT.Pipelines.SWIFTDasm");
((IPersistPropertyBag)component).Load(propertyBag, 0);
stage.AddComponent(component);
SQLTransmitterEndpoint.factory =
SQLTransmitterEndpoint.pipelineContext.GetMessageFactory();
if (SQLTransmitterEndpoint.factory == null)
{
throw new ApplicationException("Failed to create a
message factory.");
}
pipeline.InputMessages.Add(message);
pipeline.Execute(SQLTransmitterEndpoint.pipelineContext);
IBaseMessage message2 = null;
message2 =
pipeline.GetNextOutputMessage(SQLTransmitterEndpoint.pipelineContext);
.....
.....
}
}
after that when i receive msg like
{1:F01XBANTR2AAAIS8493382015}
{2:O3201450050118YBANUS33AXXX84801544610501190800N}{4:
:15A:
:20:MONEY05011809434
:21:B25654
:22A:NEWT
:30X:20050121
:57A:PNBPUS3NNYC
-}
it convert it to
<UnParsedMessage><![CDATA[{1:F01XBANTR2AAAIS8493382015}
{2:O3201450050118YBANUS33AXXX84801544610501190800N}{4:
:15A:
:20:MONEY05011809434
:21:B25654
:22A:NEWT
:30X:20050121
:57A:PNBPUS3NNYC
-}]]></UnParsedMessage>
any help???
.
- Follow-Ups:
- Re: Execute pipeline in BizTalk Custom Adapter
- From: Jan Eliasen
- Re: Execute pipeline in BizTalk Custom Adapter
- References:
- Execute pipeline in BizTalk Custom Adapter
- From: ahmad . huntash
- Re: Execute pipeline in BizTalk Custom Adapter
- From: Jan Eliasen
- Execute pipeline in BizTalk Custom Adapter
- Prev by Date: Re: BizTalk Server 2006 System.XML Error
- Next by Date: Re: Execute pipeline in BizTalk Custom Adapter
- Previous by thread: Re: Execute pipeline in BizTalk Custom Adapter
- Next by thread: Re: Execute pipeline in BizTalk Custom Adapter
- Index(es):
Loading