This post was originally published here

Connected Pawns

I wanted to know whether the out of the box  JSON encoder pipeline component creates an JSON array  if there is only one repeating XML fragment. One of my colleagues found with BizTalk 2013 he had to add an array attribute to the XML to force the creation of a JSON array (https://connectedcircuits.wordpress.com/2014/03/27/sending-json-messages-from-a-biztalk2013-adaptor/).

I created a test schema shown below and deployed it to my run time.

I created this message and consumed it with a receive location that was configured with  passthrureceive location.

<ns0:Repeater xmlns:ns0=”http://JSONTest.Repeater”>
<Repeat>Repeat_0</Repeat>
</ns0:Repeater>

The XML message was then processed on a send port with a pipeline that only contained the JSON encoder pipeline component. Voila! I got the correct output shown below;

{
“Repeater”: {
“Repeat”: [
“Repeat_0”
]
}
}

Thanks Microsoft this has saved me a lot of extra work that i had to do in BizTalk 2013.

View original post

Advertisements