Biztalk Custom Pipeline Component Development Tip

Posted at: 9/21/2006 at 8:35 AM by saravana
Pipelines are implemented in a BizTalk 2004/2006 project for a variety of reasons, including encryption/decryption, splitting single XML documents into multiple documents, and converting flat files into XML documents etc. For doing above mentioned tasks we'll be using Pipeline components (which gets deployed in different stages of a pipeline). For more information about Pipeline and pipeline components visit here

We need to follow certain procedures before the component get used by Biztalk. They are

1. After building the pipeline component in visual studio, the dll needs to be copied to the location "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" (or 2004).

Reasons for that (a) Visual Studio designer will pick up the dll from this location, so you can add them to the visual studio tools, while creating Pipelines. (2) When you start the Biztalk service the "dlls" will be loaded into the host instance (BTSNTSVC service) from this location. and (3) When an isolated host is started (by receiving messages via isolated host instance, i.e HTTP and SOAP adapter) W3WP service load the pipeline component from this location.

2. Since the dll is loaded by Visual Studio (if you have opened a Pipeline Project), BTSNTSVC Service and/or W3WP, you need to stop the BTSNTSVC service, IISRESET and close Visual Studio project (Pipelines development) before copying the dll to the location "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" (or 2004).

3. After copying you need to start the BTSNTSVC service.

4. The external components referenced within a pipeline components needs to be deployed in the GAC (Uninstall prior to installation is good).

To do the above steps each time when we make a change will end up as an annoying thing over the development period.

We can cut down some of the steps using the following steps.

1. Create a separate project for pipeline components and the external assemblies its referencing to. Don't put the pipeline components along with the solution which has Pipelines project (please note Pipelines and pipeline components are two different things)

2. Within Visual Studio, On the pipeline components project, right-click on the project, go to properties, select "Build Events" and click "Edit Post Build..." button. Copy the following script and click OK.

IF $(ConfigurationName) EQU Release GOTO done
xcopy "$(ProjectDir)$(Outdir)$(TargetFileName)" "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" /R /Y /F
IF %ERRORLEVEL% EQU 0 GOTO done
net stop "BizTalk Service BizTalk Group : BizTalkServerApplication"
iisreset
xcopy "$(ProjectDir)$(Outdir)$(TargetFileName)" "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" /R /Y /F
net start "BizTalk Service BizTalk Group : BizTalkServerApplication"
:done


3. On the external components project referenced by pipeline components, put the following script.

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i "$(TargetPath)"


The scripts are quite straight forward, all it does is copies the dll to the correct location, if it gets some sharing violation it slops, BizTalk, IIS and tries again to copy the dll. On the 3rd step it reinstalls the referenced assemblies in the GAC.

The only manual thing you need to do is, close the Visual Studio Pipeline (not pipeline component) project, referencing the pipeline component under development.

I'm sure this will help developers quite a lot of time during pipeline component development.

useful links
Pipeline Component Wizard

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: | |  Categories: BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(5) | Comments RSS

Comments

Sunday, November 26, 2006 8:12 PM
Anonymous
Anonymous
Great post!! really enjoyed reading it.
Saturday, December 16, 2006 8:44 AM
Anonymous
Anonymous
Testing
Tuesday, May 01, 2007 8:51 PM
Benjy
Hi,
Useful tip definitely. But how about GAC-ing the pipeline component itself? doesnt that need to be added to the component project post-build task?

cheers
benjy
Wednesday, May 02, 2007 11:21 AM
Saravana Kumar
Hello Benjy,
When you are working with custom pipeline component in a development environment its sufficient to place them in the \PipelineComponents folder. It's not required to GAC them.
Monday, December 10, 2007 12:01 PM
Jitender Singh Chauhan
Hi Saravana,

I am receiving a flat file with a disassembler having "Recoverable Interchange Processing = True" in custom pipeline. Now what i exactly want is to process only those records which are valid within a file and pass the invalid/incomplete records to another orchestration (Receiving only those messages which has Error Report associated with them by using filters in Receive shape).

However it runs correctly when i m using the same logic in some other orchestration just for disassembling the individual record and then Dumping both the errorous records and correct records to some physical location. Only difference in live project and the dummy is that in live i am again making a combined xml from all valid records and sending a mail notification for errorful once. When I run it with a file containing errors, I am neither getting the valid records nor the errorous records and the orchestration also shows the status as suspended.

Can u help me out in putting a parsing logic before disassembling for this kind of a scenario or is there something i am missing? Please suggest....

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading