The QuickStart Guide to Building Your First BizTalk Server 2004 Application

This guide walks you through the creation and deployment of a BizTalk Server 2004 application that copies a file from one folder and places it in another using the File Adapter. You will create an empty BizTalk Server project and then work with schemas, maps, functoids, and the built in File adapter. This should take about 30 minutes to complete and is targeted at first time users for BizTalk Server. Check out the Photo Story below to get a 2 minute multimedia overview of what you will be doing.

QuickStart Photo Story! (3MB)

Note: This guide assumes you have a complete installation of BizTalk Server 2004 and a general understanding of Visual Studio .NET development concepts.

Setup Your Environment (5 Minutes)
Step Task to Perform Task Steps Estimated Time
1. Create File Directories
  1. Create C:\BTSQuickStart.
  2. Create C:\BTSQuickStart\In.
  3. Create C:\BTSQuickStart\Out.

1 Minute

2. Set NTFS Permissions
  1. Give Everyone Full control to C:\BTSQuickStart.
1 Minute
3. Create a Strong Name Key File
  1. Open the Visual Studio .NET command prompt.
  2. Type sn -k C:\BTSQuickStart\BTSQuickStart.snk.
  3. Press Enter. The key pair will be written. You can close the command prompt.
1 Minute
4. Create and configure the BizTalk Project
  1. Open Visual Studio .NET.
  2. Create a new Empty BizTalk Server project and name it BTSQuickStart.
  3. Go to the project properties and click on the Assembly node.
  4. Set the Assembly Key File property to the path of your BTSQuickStart.snk file.
2 Minutes
Create Design Time Artifacts (20 Minutes)
Step Task to Perform Task Steps Estimated Time
1. Create a Source Schema 

 

  1. Right click on the BTSQuickStart project and Add New Item.
  2. Select the Schema template and call it Source.xsd.
  3. Rename the root node to Source.
  4. Create a new Child Record under Source.
    1. Name it BlogPost.
  5. Create a new Child Field Element under BlogPost.
    1. Name it Date.
    2. Set the Data Type property to xs:dateTime.
  6. Create a new Child Field Element under BlogPost.
    1. Name it Content.
    2. Leave the Data Type as xs:string.
  7. Create a new Child Record under BlogPost.
    1. Name it Author.
  8. Create a new Child Field Element under Author.
    1. Name it FirstName.
    2. Leave the Data Type as xs:string.
  9. Create a new Child Field Element under Author.
    1. Name it LastName.
    2. Leave the Data Type as xs:string.
  10. Save Source.xsd.
5 Minutes
2. Create a Destination Schema 
  1. Right click on the BTSQuickStart project and Add New Item.
  2. Select the Schema template and call it Destination.xsd.
  3. Rename the root node to Destination.
  4. Create a new Child Record under Destination.
    1. Name it Post.
  5. Create a new Child Field Attribute under Post.
    1. Name it DatePosted.
    2. Set the Data Type property to xs:dateTime.
  6. Create a new Child Field Attribute under Post.
    1. Name it Author.
    2. Leave the Data Type as xs:string.
  7. Create a new Child Field Element under Post.
    1. Name it Content.
    2. Leave the Data Type as xs:string.
  8. Save Destination.xsd.
5 Minutes
3. Map the Schemas and add Functoid 
  1. Right click on the BTSQuickStart project and Add New Item.
  2. Select the Map template and call it SchemaMap.btm.
  3. Click Open Source Schema.
    1. Choose Schemas, BTSQuickStart.Source.
    2. Click OK.
    3. Expand all the nodes of the schema.
  4. Click Open Destination Schema.
    1. Choose Schemas, BTSQuickStart.Destination.
    2. Click OK.
    3. Expand all the nodes of the schema.
  5. Drag the Date element of the source schema to the DatePosted attribute of the destination schema. A transform line will be drawn between the two.
  6. Drag the Content element of the source schema to the Content element of the destination schema. A transform line will be drawn between the two.
  7. Add a functoid.
    1. Open the VS.Net Toolbox and you will see a list of functoids.
    2. Drag the Scripting functoid into the middle of the transform map.
  8. Modify the Script Property of the Scripting Functoid.
    1. Choose Inline C# for the Script type.
    2. Erase the script buffer and type the following:public string ConcatAuthorName(string FirstName, string LastName){ return LastName + ", " + FirstName;}  
    3. Click OK.
  9. Drag the FirstName element of the source schema to the Scripting functoid. A transform line will be drawn.
  10. Drag the LastName element of the source schema to the Scripting functoid. A transform line will be drawn.
  11. Drag a line from the Scripting functoid to the Author attribute of the destination schema.
  12. Save SchemaMap.btm.
10 Minutes
Build & Deploy Assembly (1 Minute)
Step Task to Perform Task Steps Estimated Time
1. Build Assembly
  1. Click Build, Build BTSQuickStart.
< 1 Minute
2. Deploy Assembly
  1. Click Build, Deploy BTSQuickStart.
< 1 Minute
Create and Configure Ports (10 Minutes)
Step Task to Perform Task Steps Estimated Time
1. Create Receive Port
  1. Open BizTalk Explorer (View, BizTalk Explorer).
  2. Right Click on Receive Ports, Choose Add Receive Port.
  3. Select One-Way Port and click OK.
  4. Name it BTSQuickStartReceivePort.
  5. Click OK.
1 Minute
2. Create Receive Location
  1. Under BTSQuickStartReceivePort you will see a Receive Locations node.
  2. Right click on Receive Locations, Choose Add Receive Location.
  3. Name it BTSQuickStartReceiveLocation.
  4. Select FILE for the transport type property.
  5. Type C:\BTSQuickStart\In\*.xml for the Address (URI) property.
  6. Choose BizTalkServerApplication for the Receive Handler property.
  7. Choose Microsoft.BizTalk.DefaultPipelines.XMLReceive for the Receive Pipeline property.
  8. Click OK.
2 Minutes
3. Create Send Port
  1. In BizTalk Explorer, Right Click the Send Ports node.
  2. Choose Add Send Port.
  3. Select Static One-Way Port and click OK.
  4. Name it BTSQuickStartSendPort.
  5. Select FILE for the transport type property.
  6. Type C:\BTSQuickStart\Out\%MessageID%.xml for the Address (URI) property.
  7. Click the Send Node.
  8. Choose Microsoft.BizTalk.DefaultPipelines.XMLTransmit for the Send Pipeline property.
  9. Under Filters & Maps, choose the Filters node.
  10. Choose BTS.ReceivePortName as the property.
  11. Leave the operator value as == .
  12. Set the value to BTSQuickStartReceivePort.
  13. Click the Outbound Maps node.
  14. Select the BTSQuickStart.SchemaMap for the Map to apply property.
  15. Click OK.
5 Minutes
4. Enable Receive Location
  1. In BizTalk Explorer, Right click on BTSQuickStartReceiveLocation.
  2. Select Enable.
< 1 Minute
5. Enlist Send Port
  1. In BizTalk Explorer, Right click on BTSQuickStartSendPort.
  2. Select Start.
< 1 Minute
Test Application (2 Minutes)
Step Task to Perform Task Steps Estimated Time
1. Create XML Instance
  1. In Solution Explorer, right click on Source.xsd.
  2. Choose properties.
  3. In the Output Instance Filename property, type C:\BTSQuickStart\Instance.xml.
  4. Click OK.
  5. Right click on Source.xsd again and choose Generate Instance.
1 Minute
2. Drop File
  1. Go to C:\BTSQuickStart.
  2. Drop Instance.xml into C:\BTSQuickStart\In.
  3. BizTalk will pickup the message, transform it and move it to C:\BTSQuickStart\Out.
  4. Examine the structure and content of both XML files.
1 Minute