Forum Discussion
SanjivGupta, I've previously posted about setting ContentType for outbound messages using SB-messaging - please consider this for CU1 since the problem remains in BTS2020.
The SB-Messaging adapter does not offer a default value for ContentType to be specified on a send port. If you encode the outbound message using the JsonEncoder pipeline component the adapter will set ContentType to "application/xml; charset=utf-8".
I've tried to add the value via promoting context properties for the adapter schema "http://schemas.microsoft.com/BizTalk/2012/Adapter/BrokeredMessage-properties" but the MessageInspector does not honor the ContentType property - it does handle all other properties offered via the send port configuration.
I've also tried a custom version of the JsonEncoder component with the addition of specifying ContentType and Charset on the body part but that doesn't work either.
Why can't we specify what the ContentType should be for an outbound SB message? This metadata has no impact whatsoever on the BTS send operation but it has an impact for the receivers (fetching messages from a queue) since they have to ignore the standard ContentType value.
As far as I can understand this is either a bug in the implementation where the ContentType value is not assigned according to the context property or it has something to do with the serializer used by the WcfTransmitter.
Looking at the Microsoft.BizTalk.Adapter.SBMessaging.SBMessageInspector.BeforeSendRequest the ContentType is missing both from the default value assignment (which is logical since it's not available on the send port properties) and the iteration of context properties (which I suspect is a bug).
/andreas