Ravindar, Biztalk Developer and Administrator

Just another BizTalk blog

BizTalk application stop issue

As a regular practice to stop Biztalk application through powershell we use following method

But today we faced an interesting issue while stopping one applicaiton.
This application has a reference to other application and uses the send port of the referred application to bind to the logical port of the orchestration.
so when we use the above method, powershell was throwing following error.

Exception calling “SaveChanges” with “0” argument(s): “Could not unenlist Send Port ‘Send.Common.ActivityLogging.FromApplication’.

2018-05-17T14:59:20.1279353Z Orchestration(s) xxxx is(are) started, which depend(s) on this send port.”}

This was happening because the referred send port was also used in other application and they are in started mode.
The StopMethod with parameter “StopAll” attempts to stop all the artifacts used in application including the referenced artifacts in use.
in reality no one wants the referred application to be stopped,  only current application has to be stopped. To handle this case, you need to go with the following code

May 18, 2018 Posted by | Uncategorized | Leave a comment

Testing multi part message map in BizTalk

There are instances where you want to test a map  with multipart input message (more than one input message).

the usual approach is to do a test map and take the auto generated sample file, edit it with required data. This is really a tedious task.

There is a nice tool developed by Tomasso to easily select the sample files and create a merged message and execute map from the tool

we can download the tool from


and also refer following



September 15, 2017 Posted by | Uncategorized | Leave a comment

Working with boolean or non-string variables passing to c# method from BizTalk map

The rule here is all the variables inside the BizTalk map are string variables (even if it’s date or boolean or any other).

you would need to explicitly convert them back to there original types before you can use them in the methods.


for example

if you are passing a boolean variable to a method and the c# method signature is like below with the parameter type defined as bool

public static string MyMethod(bool isEligible)


in this case, the c# method will always recieve the isEligible parameter value as true (even if it’s value is sent as false from BizTalk map).


this is because, Biztalk map always operates on string variables, and in this case, when it sends the value “false” to this c# method, and since the method signature defines the variable as type bool, it will just check if the object exists and since the object always exists(as you are passing it), the value of isEligible parameter will always gets set to true.


so, in order to make it behave as we want, we need to define the parameter type as string like below

public static string MyMethod(string isEligible)


and before using it, you need to explicitly convert it to the bool type

bool convertBoolisEligible = System.Convert.ToBoolean(isEligible);


September 14, 2017 Posted by | Uncategorized | Leave a comment

Constructing a Biztalk Message without Construct shape

As mentioned in the following url


you can construct a message without using a construct shape

construct OutboundMessage {

@"<?xml version='1.0' standalone='yes' ?>
<Root id='012345' xmlns='http://schemas.sample.org/BizTalk/2010/input' />

OutboundMessage = XmlDocument;



September 11, 2017 Posted by | Uncategorized | Leave a comment

Limitations of making dateTime field as distinguished in BizTalk

I came across an issue related to DateTime conversion yesterday. The Datetime was coming 10hours ahead than expected. Although the value was being passed correctly , it was receiving 10hours ahead time and this revealed a strange behaviour of BizTalk while assigning dateTime fields.


The root issue was the DateTime field was a distinguished filed and when the value is being assigned in orchestration, it automatically converts to UTC But the Time zone is lost. In this case, BizTalk does not behave as expected, although you pass local time, when the value is assigned to a distinguished datetime filed.


The behaviour is clearly elaborated  here  http://www.malgreve.net/2012/10/03/datetime-xml-element-converted-to-utc-how-to-read-the-original-time-of-a-different-time-zone/

In c# it will work fine, but in Biztalk Orchestration if we assign value to distinguished dateTime field, the Time zone will be lost.


Ultimately to read the correct value, we had to use the method DateTime.SpecifyKind(param1, DateTimeKind.Local);   to get the correct time.


So firstly it’s good to avoid making the datetime fields as distinguished, otherwise if it is mandatory to make a datetime filed as distinguished, please keep this limitation in mind and use the above method to get the desired output.

August 30, 2017 Posted by | Uncategorized | Leave a comment

System.InvalidOperationException: Text cannot be written outside the root element

I was  working with SOAP UI and i copied text to the mock service response and the Biztalk WCF send port started giving the error “System.InvalidOperationException: Text cannot be written outside the root element”

it’s due to the white spaces in the response message.


the fix for it to continue your work locally is , on the send port set the Body path expression value as “/*” as shown


WCF port ignore white spaces

August 25, 2017 Posted by | Uncategorized | Leave a comment

Biztalk Tracking data not visible

TrackingData table rows count should usually be close to 0.

but if we see huge count here, it means there is an issue with Tracking host.

SELECT COUNT(*) FROM [BizTalkMsgBoxDb].[dbo].[TrackingData]

create a new host, create a corresponding new host instance and remove the old ones. This should fix the issue



August 17, 2017 Posted by | Uncategorized | Leave a comment

Octopus variable not identifying HTML content

You should define your variable in settings file generator like
#{variable name here | HtmlEscape}

so you should add the escaping character

August 10, 2017 Posted by | Uncategorized | Leave a comment

Purpose of each tables in BiztalkMgmtDb


June 26, 2017 Posted by | Uncategorized | Leave a comment

Loop through a set of variables or set of elements

To loop through a set of specific variable values

<xsl:for-each select="$var1 | $var2 | $var3 ">
<xsl:if test=".!=''">   (to test if the varirable value is not null)

<xsl:value-of select="."/>
<xsl:if test="not(position() = last())">,</xsl:if>   (to avoid last comma)



 if you want to loop through a set of node values

<xsl:for-each select="element1Xpath/text() | Element2Xpath/text()| ElementNxpath/text()">
        <xsl:value-of select="."/>
        <xsl:if test="not(position() = last())">,</xsl:if>

June 11, 2017 Posted by | Uncategorized | Leave a comment