Thursday, November 2, 2017

Read Promoted properties in Orchestration from XmlDocument Message


When the PropertySchemaBase property is set to MessageDataPropertyBase, it means that the value of the promoted property corresponds to data in the message, such as the value of some field. When the PropertySchemaBase attribute is set to MessageContextPropertyBase, it means that the value of the promoted property may be from somewhere else, such as an envelope, or that it may be set by a pipeline component.


So, change the PropertySchemaBase property to MessageDataPropertyBase for all Promoted fields in Property schema.

We can bale to read the promoted property value by assigning the untyped document (XmlDocument) to XLANGMessage.

Declare the varXlangMessage is an orchestration variable of type Microsoft.XLANGs.BaseTypes.XLANGMessage. Use below code to read the property value.

varXlangMessage= msgXmlDocument;
varValue = System.Convert.ToString(varXlangMessage.GetPropertyValue(typeof({YourPropertySchema}.{PromtedProperty})));

Subscribe for Routing failure on Delivery Notifications (NACK messages)

I could not found exact solution for this, i followed below work-around, but it won’t solve all of the problems and side effects. The idea is to create an orchestration which subscribes to all NACK acknowledgments. That is to say:
·         The message type of the incoming message will be XmlDocument
·         The BTS.AckType property == NACK
·         The logical receive port will use direct binding
By doing so, all acknowledgments will be consumed by an instance of this orchestration, thus avoiding the routing failure.