This is a very basic example that will walk you through the steps to set up a simple file transfer using BizTalk Server 2004. This example assumes that you already have BizTalk setup correctly (unlike my first setup snafu). I'm running on Windows Server 2003 and running BizTalk Server 2004 Developer Edition.
I'm trying to start to follow the xp programming techniques, so when I started a new BizTalk project I decided to try the simplest thing first and just do a file transfer. Below are the steps I came up with for transferring a file just by using the BizTalk Explorer pane in Visual Studio.
1) In the BizTalk Server Explorer, expand your server by clicking the plus next to it.
2) Right click “Receive Ports” and select “Add Receive Port...” from the context menu as shown below.
3) In the Create Receive Port dialog, leave “One-Way Port” selected and click OK.
4) In the One-Way Receive Port Properties dialog, change the name to “ReceivePort_Static” as shown below.
5) Click OK.
6) Back in the BizTalk Explorer panel, under the ReceivePort_Static port, right click “Receive Locations” and select “Add Receive Location...” from the context menu as shown below.
7) In the Receive Location Properties dialog perform the following actions:
a) Change the Name: to “ReceiveLocation_Static“.
b) Change the Transport Type to “FILE”.
c) Change Receive Handler to “BizTalkServerApplication“. Note: if this option isn't available then your server might not be configured correctly. Read the documentation section on Configuring your server.
d) Change the Receive Pipeline to “Microsoft.BizTalk.DefaultPipelines.PassThruReceive”.
e) Finally, click in the Address (URI) field and then click the “...” button. For the receive folder you will need to put the path to a folder you want BizTalk to pickup the files from. I created a folder specifically for this at c:\tests\StaticTest\Receive. I would suggest you do the same. The file mask for this example will be "*.txt". This setup is shown below.
f) Click Ok on the File Transport Properties dialog. Your Recieve Location Properties Dialog should look something like the following.
g) Click Ok on the Receive Location Properties dialog.
8) Back in BizTalk Explorer, right click “Send Ports” and select “Add Send Port...” from the context menu as shown below.
9) In the Create New Send Port dialog, leave “Static One-Way Port” selected and click OK.
10) In the Static One-Way Send Port Properties dialog, perform the following actions:
a) Change the Name: to "SendPort_Static".
b) Change the Transport Type to "FILE".
c) Click in the Address (URI) field and then click the "..." button. For the destination folder you will need to put in the path to a folder you want BizTalk to deliver the files to. I created a folder specifically for this at c:\tests\StaticTest\Send. The file name for this example is %MessageID%.txt. This is shown below.
d) Click Ok on the File Transport Properties dialog. The Configure Static One-Way Send Port Properties dialog should look like the following.
e) Next click on the "Send" folder in the tree view control on the dialog. Change the Send Pipeline to "Microsoft.BizTalk.DefaultPipelines.PassThruTransmit" as shown below.
f) Next Click on the "Filters & Maps" folder in the same tree view control and then click on "Filters". Click where it says "Click here to add a new row!" In the Property dropdown select the "BTS.ReceivePortName" and in the Value field put "ReceivePort_Static" (without the quotes). This is shown below.
g) Click Ok on the Configure Static One-Way Send Port Properties dialog.
11) Back in the BizTalk Explorer, right click the ReceiveLocation_Static and select "Enable" from the context menu.
12) Next right click the "SendPort_Static" and select "Start" from the context menu.
At this point, assuming everything was done correctly, you should be ready to experience some of the BizTalk magic. Drop any file with the txt extension into the folder you specified on the receive location and it will quickly disappear. If you next look in the folder you specified for the send port and there should be a new text file there which is a copy of the file you dropped in the receive location. Magic!
Hopefully you will find this very simple example to be useful.