|
Home > Archive > BizTalk Server General > June 2004 > Converting BTS2002 Preprocessor to BTS2004 Pipeline Component
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Converting BTS2002 Preprocessor to BTS2004 Pipeline Component
|
|
| Jeff Lynch 2004-06-28, 8:46 am |
| 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 the
"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?
J. Lynch
E-Commerce Manager
Gulf Coast Seal
| |
| Gilles [MSFT] 2004-06-28, 8:46 am |
| 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 the
>"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 you 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 location) but this
is a minor issue.
Make sure you forward the message unchanged to BizTalk after you saved it and 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.
|
|
|
|
|