06-28-04 01:46 PM
Hello,
>In BTS2002 I wrote a simple custom preprocessor for a file receive function
>(in C#) that copied the inbound message XML file to a "history" folder for
>safekeeping. I'd like to convert this preprocessor to a custom pipeline
>component to do the same in BTS2004 but I'm confused about the differences
>between the BTS2002 "IBTSCustomProcess.Execute" method and the BTS2004
>"IComponent.Execute" method as shown in the "FixMsg.cs" sample in the
>BTS2004 SDK.
>
>In my BTS2002 preprocessor I used the following code to copy the file to th
e
>"history" directory.
>
>FileInfo myFile = new FileInfo((string)vDataIn);
>myFile.CopyTo(myFile.DirectoryName + @"\history\" + myFile.Name, true);
>
>Can the same thing be done in the custom pipeline component and if so, how?
In BizTalk 2004, the message will be presented to you as a stream. Moreover,
there
can be more than one part in the message (envelope, body ...) so make sure y
ou save the
one that is appropriate for your application.
You might have to deal with file system premissions issues (i.e. the
user under which the pipeline runs should have read/write access to the loca
tion) but this
is a minor issue.
Make sure you forward the message unchanged to BizTalk after you saved it an
d you should not have any problem.
One detail, the stream you receive should be rewinded before you hand it off
to BizTalk or your pipeline will fail.
If you have specific problems, feel free to post here.
Thanks.
-Gilles.
[ Post a follow-up to this message ]
|