Share this

There is no value associated with the property ‘BTS.MessageID’ in the message.

In the following orchestration (This is the HelloWorld sample application at C:\Program Files (x86)\Microsoft BizTalk Server 2013\SDK\Samples\Orchestrations\HelloWorld\)     Inside the message assignment shape I have added the following code. System.Diagnostics.EventLog.WriteEntry("HelloWorld",InvoiceMessage(BTS.MessageID)); Now when I deploy and test the HelloWorld application, I get the following error xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule(e0eddb10-5fb9-a44c-aa06-423456a70585)'. The service instance will remain suspended until administratively resumed or terminated. If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception. InstanceId: fbaf254b-ac0f-4b8d-b1ed-94a58d7f8cd9 Shape name: ConstructInvoice ShapeId: 619c4eb0-2371-4cb6-a60c-eae729be8693 Exception thrown from: segment 1, progress 6 Inner exception: There is no value associated with the property 'BTS.MessageID' in the message. REASON There are 2 ways message gets created in the message box 1. Message is published by receive port or orchestration. --In this case message ID will be created as soon as the message gets into the MessageBox database. 2. Message is created in orchestration using construct shape. --In this case the message will be created first in-memory representation on orchestration and it will be created into the MessageBox database only once the persistence point comes in the orchestration. So in the above orchestration we are trying to use the Message ID of the newly created message(InvoiceMessage) in the construct shape which is not been yet created. The Message ID is created ONLY on persistence (normally the send shape adds the persistence point) or during any activity that cause the Message to be published to the MessageBox. SOLUTION 1. If you are using Message ID as a unique identifier may be for co-relation or something like that then its advisable to use Orchestration Instance ID,  Microsoft.XLANGs.Core.Service.RootService.InstanceId For the scenario mentioned above I changed the code to following and it worked. System.Diagnostics.EventLog.WriteEntry("HelloWorld", Microsoft.XLANGs.Core.Service.RootService.InstanceId.ToString());  2. You can either you the message which is already published to message box. For the scenario mentioned above if I change the code to following it will also work because here the POMessage is already published in MessageBox by the receive port. System.Diagnostics.EventLog.WriteEntry("HelloWorld", POMessage(BTS.MessageID));   Also refer the MSDN forum link https://social.msdn.microsoft.com/Forums/en-US/5e6df6f2-a4cf-4e75-b2eb-ed7cb1553085/btsmessageid-is-not-working-with-new-constructed-message?forum=biztalkgeneral  

Loved this? Spread the word


Gautam

Follow me here

About the Author

My name is Gyanendra Kumar Gautam. I am Solution Consultant, who basically works to hook the stuff together using Microsoft technologies like Azure PaaS, Azure Serverless Services, Microsoft BizTalk Server, and Azure DevOps Services.

You may also like

The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.

Yesterday this error came for one of the deployment on production. But the same deployment was working fine on staging environment. A message received by adapter “MSMQ” on receive location “RL_XYZ_RES_09” with URI “FORMATNAME:DIRECT=OS:.\PRIVATE$\XYZ_RES_09” is suspended. Error details: There was a failure executing the receive pipeline: “BTSHttpDecoder.DecoderPipeline, BTSHttpDecoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5793a821957af7d1” Source: “MessageDecoderPipelineComponent_F09” Receive Port:

Read More

BizTalk Project Template is missing in Visual Studio 2012

I ran couple of times into this issue so thought of documenting it here. So first of all development of BizTalk Server 2013 application is only supported on Visual Studio 2012. In short, to get BizTalk Project Template do the following steps: Install Visual Studio 2012 Install SQLServer2012 or SQLServer2008R2 SP1 Install BizTalk Server 2013  – Select (mark

Read More

There is no value associated with the property ‘BTS.MessageID’ in the message.

In the following orchestration (This is the HelloWorld sample application at C:\Program Files (x86)\Microsoft BizTalk Server 2013\SDK\Samples\Orchestrations\HelloWorld\)     Inside the message assignment shape I have added the following code. System.Diagnostics.EventLog.WriteEntry(“HelloWorld”,InvoiceMessage(BTS.MessageID)); Now when I deploy and test the HelloWorld application, I get the following error xlang/s engine event log entry: Uncaught exception (see the ‘inner exception’ below)

Read More

Never miss a good story!

 Subscribe to my blog to keep up with the latest news!