Monday, 7 September 2015

BizTalk Untyped Message Promoting MessageType Context Property

Handling UntypedMessage message is a bit of fun in BizTalk . You could assign anytype of message at your construct shape and submit to messageBox. However Untypeed message will not promote MessageType to BizTalk Context.

Here is a simple scenario where you would need a MessageType is a Key Element to handle at your BizTalk Send Port Collection.

Scenario :  An orchestration designed with Request-Response Port which receive multiple requests (Schema published as WCF Service) and you would eventually submit transformed message to SEND Port.
The Send Port Message has been defined as UnTyped Message. So the Static SendPorts has configured at Biztalk Admin Console to Subscribe a request based on MessageType Filter property.

Problem:
When I submit a Untyped message to SendPort it doesn't recognize the Message due to missing the Context property of "BTS.MessageType"
So I tried by adding Correlation as BTS.MessageType at SendPort but it doesn't work. Finally I made a simple component which promote MessageType for UnTyped Message.

Solution :
----------------------------------------------------------------------------------------------------------------------
namespace RajWebjunky.Utility
{
    [Serializable]
    public class ContextPromoteHelper
    {
        //Assingn Context message for incoming "UnTyped" message
        public static void PromoteMessageType(XLANGMessage inMessage)
        {
            ReceivePipelineOutputMessages pipelineMsg = XLANGPipelineManager.ExecuteReceivePipeline(typeof(Microsoft.BizTalk.DefaultPipelines.XMLReceive), inMessage);
            pipelineMsg.MoveNext();
            pipelineMsg.GetCurrent(inMessage);
        }
    }
}
----------------------------------------------------------------------------------------------------------------------
The above component should invoke before you submit message to SendPort
at your Orchestration Construct Shape


Drop a comment if this article helps you. you can reach me @ raj.webjunky@yahoo.com

1 comment:

  1. Biztalk Admin |Training|Job Support|Corporate|+91-741-626-7887 Training - BizTalk Administrator|Microsoft BizTalk Server|BIZTALK Online| Corporate| Classroom training|Job Support at Layman Learning www.laymanlearning.com --- Send Enquiry --- hr@laymanlearning.com training,biztalk administrator,microsoft biztalk server,biztalk online,corporate,classroom training,job support,it support,online training,corporate training,24/7support services

    ReplyDelete