Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / biztalk

Simple BizTalk Project without Orchestration

5.00/5 (8 votes)
2 Mar 2014CPOL6 min read 43.7K  
Simple Message only BizTalk Project

Introduction

Most Techies have a perspective of BizTalk as an Orchestration based solution. But designing the solution with orchestration makes a round trip to Message box.

Whenever complex business logic needs to be designed, the Orchestration is the best approach to follow.

But, if you need to implement simple transformations with no business logics, The Best approach would be the Message-only Solution, which avoids the round trip to Message box and increases the through-put of the solution.

Let us quickly create a message only solution without orchestration J

Steps

  • Creating a BizTalk Input & Output Schema

  • Creating a Map

  • Creating the instance of the Input message

  • Deploy the Solution

    • Pre Deployment Steps

    • Deployment

  • Configuring Application

    • Post Deployment Checks

    • Configuring Receive Port/Location

    • Configuring Send Port

    • Configure map in send port

    • Configuring Filters in send Port

    • Post-Configuration Tasks

  • Testing the Solution

  • Trouble shoot on Failures

Creating a BizTalk Input & Output Schema

  1. Start>>Visual Studio 2010 >> BizTalk >> Empty BizTalk Server Project

Rename the Name and Solution Name as MessageOnlySln

Image 1

  1. In Solution Explorer, Right Click the project and Add>>New Item

    Image 2

  2. Select the schema from the Items and Rename the schema as ReceiveSchema.xsdImage 3

  3. A new schema will be formed with the root element as ‘root’, just rename the root as ‘Input’

BizTalk Identifies the Messages through the Message Type. Message type is an integral part of ‘NameSpace#Root’

Image 4


  1. Now create two child field elements as FirstName and LastName as string(default) datatype

Image 5

At last the ReceiveSchema should be like this

Image 6

  1. Follow the above steps 2,3,4,5 and create a SendSchema.xsd with one child field element as ‘FullName’

Image 7

Creating a Map

Map is a Message Transformational object in BizTalk. The Conversion of schema ReceiveSchema and SendSchema will be carried here. Maps are internally a XSLT Transformation.

Let us create a simple map

  1. Create a new map and name it as ConcatenateMap.btm

Image 8

  1. Map will be created with links as Open Source Schema and Open Destination Schema

Image 9

  1. Click on those links and Select the Source(ReceiveSchema.xsd) and Destination Schema(SendSchema.xsd)

Image 10

  1. After selecting the schemas, expand the root node to have a visibility of underlying elements

Image 11

  1. Let us do a simple concatenation of FirstName and LastName (Source Schema) to FullName(Destination Schema)

  2. Drag and drop the String concatenate functoid

Functoids are ready-made logical functions which is available for transforming the data in map

You can see the warning shown in the functoid, because of no input/output is provided

Image 12

For all the Functoids, there will be an description, which you can find once you double click the same

Image 13

  1. Now drag the Link from the FirstName and LastName elements from Source schema to the left side of Concatenate functoid and link the result(right side)to the FullName element of Output schema

  2. Note that functoid warning symbol has been disappeared

    Image 14

    As said earlier Map is internally an XSLT… Let’s see how the xslt is formed for this map.

    Right click the ConcatenateMap.btm and click validate map

    Image 15

    If you click on the output link of XSLT

    Image 16

    You can see the xslt as below:

    Image 17

    With this we have created the functionality. But we should do unit test before deploying, for now I am skipping that part J

Creating the instance of the Input message

  1. To create an instance, Right click the ReceiveSchema.xsd and Generate instance

    Image 18

    The schema’s instance will be generated in the location. The Output window will show the location as:

C:\Users\<PC-Name>\AppData\Local\Temp\_SchemaData\ReceiveSchema_output.xml

  1. Open the instance file

Image 19

  1. As the Generate instance will be default field name will values, change it as desired

    Image 20

  2. Keep this file ready before testing.

Deploy the Solution

We are done Lets Deploy the SolutionJ

Pre Deployment Steps

  1. All the BizTalk Artifacts (Schemas,Maps,orchestration) or full projects has to be made the strongly named before deploying

  2. Goto MessageOnlySln project in solution explorer and right click and click on properties

    And Navigate to signing Tab in the left pane

    Image 21

  3. Click on sign the assembly and choose a strong name key file as ‘new’

    Image 22

  4. Give the filename as ‘MessageOnlySlnKey’ and uncheck the ‘Protect my key file with a password’

    Image 23

  5. A new Key will be created in the solution explorer as below

    Image 24

  6. Now go to the Deployment tab

    Image 25

  7. Now Create the application name as ‘MessageOnlyAppln’, this name will be used for creating application in BizTalk Admin Console.If this is not specified this solution will be deployed in the default application(BizTalk Application 1)

    Image 26

    Save all the unsaved artifacts…!

    Deployment

  8. Now Right click on the Project in solution explorer and click on deploy

    Image 27

  9. The deploy started text will be displayed on Visual studio left bottom

    Image 28

  10. Deploy Succeeded after some time

    Image 29

  11. New Application called MessageOnlyAppln is formed in BizTalk Admin console

    Image 30

    Note: In case of errors,

    1. Please ensure that Biztalk necessary services are up and running

    2. In case of Access Denied errors, Restart visual studio as administrator

    3. Also make sure you have not missed out any steps mentioned above

Configuring Application

Post Deployment Checks

  1. Make sure the schema and maps are available in the respective areas in the console

Image 31

Image 32

Configuring Receive Port/Location

Ports are the sources of Publish subscribe model in BizTalk. All the Messages are published/Subscribed by the ports in BizTalk

Configuring Receive Port/Location

  1. Create a new Receive port

    Image 33

  2. In General tab Rename the port as InboundRcvPort

    Image 34

  3. Create Receive Location

    Click on the Receive locations in the same window and click on new as shown below

    Image 35

  4. Configure Receive Location as below

    Image 36

  5. Click on Configure button and provide the location of Inbound folder

    Image 37

  6. Click ok on all the underlying windows

  7. Make sure Receive location is available as below

    Image 38

Configuring Send Port

The Message will be picked up by the File based Receive Adapter>> It will be transmitted to Receive port and Delivered to message box

Now we need to subscribe to this delivered message through any of the Context properties(BTS.ReceivedFileName) to apply the Outbound map. Here the map will be applied in the send port.

  1. Create a Send port as below

    Image 39

  2. Click on Static One-way send port and rename as ‘OutboundSendPort’ and make all configurations as below

    Image 40

  3. Click on the Configure button and provide the Outbound folder location

    Image 41

Configure map in send port

  1. Click on the outbound maps in the same window on the left pane

  2. Select the map as shown below

    Image 42

  3. Click on apply

Configuring Filters in send Port

Filters are the ones which subscribes to the messages from Message-Box

  1. Go to filters tab on left pane in same window and select the context property

    ‘BTS.ReceivedPortName’ from drop down

    Image 43

  2. Provide the value to the property as ‘InboundRcvPort

    Image 44

  3. We can select any context properties(like BTS.MessageType) based on your requirement

  4. Apply all the settings and click on ok on all windows

Post-Configuration Tasks

The Receive Location and Send port will be in disabled state, Right click and enable the same

Image 45

Image 46

2. Make sure the host instance BizTalkServerApplication is up and running

Image 47

Testing the Solution

As we are done with all configuration part, now it’s time to test the entire solution.

  1. Copy the instance file which you have generated in the previous task

    Image 48

  2. Place the file in the Inbound folder configured in receive location

Image 49

  1. The file will be immediately picked up and output will be transformed and placed in the output folder with unique MessageID as name

    Image 50

  2. Output file will be formed as

    Image 51

    Ha!!! , We have done this JSolution is working as expected.

Trouble shoot on Failures

  1. If the file has not been formed in the send folder,

    1. Double check the filter property and Value configured

    2. Make sure the Send Location is configured is valid

  2. For more assistance check the Suspended Service instances to get the exact problem

With this we have learnt how to make a simple Message only solution in BizTalk.

Hope this helps…!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)