BizTalk 2013 R2 JSON Encoder error – “Object reference not set to an instance of an object” – Part 2

Posted: November 29, 2015  |  Categories: BizTalk Uncategorized

In a previous post I lamented that the JSON encoder pipeline component throws an error if a soap fault is sent to it. My colleague Deepa Kamalanthan has developed a workaround to this issue. The clue to this was taken from a previous post by Johann Cooper. The JSON encoder pipeline component in our send pipeline was replaced with XML Dissembler and the BREPipelineFrameworkComponent pipeline components. The BRE Pipeline Framework is configured to dynamically chose whether to include the JSON encoder pipeline component in pipeline processing or not. This shown below


A business rule is configured that only executes the JSON Encoder if the message has a type of Orders.


If a SOAP fault is sent as a response, the JSON Encoder is not executed and is subsequently sanitized by a custom behaviour. This custom behaviour changes SOAP fault to simpler error message that only contains basic information in a JSON format.

In summary we are pleased the BRE pipeline component has given us a way to work around this problem. I believe the JSON encoder should provide some out of the box mechanism to handle a soap fault and I hope Microsoft address this in a future release of BizTalk.


Back to Top