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
Comments (36)

  1. ahmad says:

    I am facing problem in section "Create and Configure Ports".

    When i try to configure "2-Create Receive Location" then at step 6 i cannot set "Receive Handler" property, i can see nothing to select in this property even i cannot write anything….

    any idea

  2. Luke Nyswonger says:

    BizTalkServerApplication is the name of the host for the receive handler. Do you have this host up and running? You also need to ensure you pick the transport type property before setting this property or you will not be able to modify the value.

  3. Ahmad says:

    Thanks Luke!

    i have successfuly created the application but now when i Drop Instance.xml into C:BTSQuickStartIn then nothing happens… what i am missing to do?

  4. Luke Nyswonger says:

    Take a look at your application event log. It should tell you what the problem is…or at least give you some clue 😉 Feel free to post the error message here for analysis.

  5. Ahmad says:

    I can see this error many times:

    ====================================

    Event Type: Error

    Event Source: ENTSSO

    Event Category: Enterprise Single Sign-On

    Event ID: 10589

    Date: 11/23/2004

    Time: 5:28:48 AM

    User: N/A

    Computer: SPIDER

    Description:

    The master secret has not been backed up. If you lose the master secret all the information stored in the SSO system will be lost permanently and your systems may fail to work correctly. Please use the SSO admin tools to back up your master secret.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    ===============================================

  6. Luke Nyswonger says:

    Hi Ahmad,

    This message just indicates you haven’t backed up the master secret. You should back it up. Do the following:

    1. Open a command prompt

    2. Browse to C:Program FilesCommon FilesEnterprise Single Sign-On

    3. Type ssoconfig -backupsecret C:ssobackup.bak

    W/R/T your problem, ensure you have enabled and enlisted the ports and that your application is running. Thanks!

  7. Ahmad Billah says:

    Hi Luke,

    I have backed up master secret and ports are enabled & enlisted but still facing the same problem.

    i can see Host in BT Admin Console but when i select a host in the list, i can’t see any instance of that host, do i have to have instance of host to work my application properly???

    what do you mean by "application is running", how i can check wether its running or not? …

    Thanks!!!

  8. Ahmad Billah says:

    Hi Luke,

    I have backed up master secret and ports are enabled & enlisted but still facing the same problem.

    i can see Host in BT Admin Console but when i select a host in the list, i can’t see any instance of that host, do i have to have instance of host to work my application properly???

    what do you mean by "application is running", how i can check wether its running or not? …

    Thanks!!!

  9. Ahmad Billah says:

    Hi Luke,

    I have backed up master secret and ports are enabled & enlisted but still facing the same problem.

    i can see Host in BT Admin Console but when i select a host in the list, i can’t see any instance of that host, do i have to have instance of host to work my application properly???

    what do you mean by "application is running", how i can check wether its running or not? …

    Thanks!!!

  10. David says:

    Finally! A sample that is working and that I can learn from. All the samples in the SDK are provided as is, without any explanations and are to a newbie almost worthless.

    This worke dfirst time and explained the magic step that I have not been able to do before, to connect the incoming and outgoing parts.

  11. Rajiv Popat says:

    This is EXACTLY the kind of starter examples the BizTalk Help and documentation should contain!! Sadly the BizTalk Startup Modules end up being way to complicated for a person starting BizTalk for the first time and end up being utterly USELESS!

    This is a GREAT example – something that is simple enough to understand and try and then move on to more complex examples! thanks.

  12. Jeff says:

    Excellent example. Thanks!

  13. Todd says:

    I am using BT 2006, and when I click on Outbound maps, I do not have any options. There does not appear to be any way for me to apply the map that I created.

  14. Todd says:

    Nevermind. Refresh needed after deploy.

  15. Mike says:

    Exactly what I was looking for.

    Now I need to work out how to transform flat files. I can’t go to 2006 at the mo.

    Mike

  16. rajeshak says:

    I am getting this error when building the application. Any thoughts.

    Performing main compilation…

    D:RESEARCHBiztalkServer2004BTSQuickStartSourceBTSQuickStartBTSQuickStart.btm(4,95): error CS0234: The type or namespace name ‘source’ does not exist in the class or namespace ‘BTSQuickStart.BTSQuickStart’ (are you missing an assembly reference?)

    D:RESEARCHBiztalkServer2004BTSQuickStartSourceBTSQuickStartBTSQuickStart.btm(4,6): error CS1501: No overload for method ‘SchemaReferenceAttribute’ takes ‘1’ arguments

    D:RESEARCHBiztalkServer2004BTSQuickStartSourceBTSQuickStartBTSQuickStart.btm(5,100): error CS0234: The type or namespace name ‘Destination’ does not exist in the class or namespace ‘BTSQuickStart.BTSQuickStart’ (are you missing an assembly reference?)

    D:RESEARCHBiztalkServer2004BTSQuickStartSourceBTSQuickStartBTSQuickStart.btm(5,6): error CS1501: No overload for method ‘SchemaReferenceAttribute’ takes ‘1’ arguments

    Build complete — 4 errors, 0 warnings

  17. w33rf says:

    swfseeffe

  18. atin says:

    i have done the same as mentioned in ur tutorial…i have taken the sample as in C:Program FilesMicrosoft BizTalk Server 2004SDKSamplesAdaptersSubmitDirect and modified the adpaters to File..

    now my message gets thru the Biztlak and i am able to get output on my ‘out’ folder but map transformation is not applied to that…i get the same input xml file …..

    plz help me asap…

    thanks

  19. Ronald Visser says:

    Thank Luke,

    Your tutorial helped me a lot to understand the basic of BizTalk and Visual Studio!

  20. Al U. Minium says:

    I have followed the tutorial step by step and the excitement was enormous when I dropped the instance.xml into the ‘In’ folder. It got even better when the BizTalk server consumed the file!!

    The disappointment, however, was unbearable when no xmlfile could be found in the ‘Out’ folder…

    I can see from the ‘Health and Activity Tracking’ – tool under ‘Find Message View’ that the messages are being handled as send events, but no Receive Events have been detected!?!

  21. What did your event logs say? There should be an error/warning in there that describes the problem. Could be permissions…

  22. sharon says:

    hi Luke,

    Well I was following your tutorial and all was well until I tried to creating the receive port, then I got an error that the rpc server is unavailable, I checked my event log and noticed an error like the one mentioned above about backing up the master secret but when I try to do this on the command prompt it just says again:

    ERROR: 0x800706BA : The RPC server is unavailable.

    I have installed this on my own laptop with windows xp sp2, I followed the following page to install it and it all seems to be ok:

    http://aspadvice.com/blogs/biztalk/archive/2006/04/25/16882.aspx

    do you have any idea what I might need to do?

    Thanks,

    Sharon

  23. Hi, this article will help troubleshoot your RPC issues (SSO or not!)

    http://support.microsoft.com/?kbid=841893

  24. sumeshr says:

    Thats a pretty good start.

    Thanks for that.

  25. Andrew says:

    I am having same problem as Todd (see quote below) however I am using BT 2004. One of the other gentlemen in my company said that this is simply a bug in the program, is this the case, or is there something I am missing? I believe I have followed all tutorial steps to that point correctly. Thanks in advance.

    [Quote]I am using BT 2006, and when I click on Outbound maps, I do not have any options. There does not appear to be any way for me to apply the map that I created. [/Quote]

  26. anujais says:

    Hi Luke,

    While deploying the BTSQuickStart i am getting following error.

    An error occurred while enlisting in a distributed transaction.

    Unspecified exception: An error occurred while enlisting in a distributed transaction.

    Thanks

    Jais

  27. anujais says:

    hi Luke

    While deploying it i am getting the following error, can you please look into this

    An error occurred while enlisting in a distributed transaction.

    Unspecified exception: An error occurred while enlisting in a distributed transaction.

    Thanks

    Jais

Skip to main content