Sending JSON messages from a BizTalk2013 adaptor

connectedcircuits

I had a requirement where I needed to send a message to a web API that only accepted messages as JSON.

BizTalk2013 provides a WCF-WebHttp adaptor for sending sending XML messages to a REST endpoint but not in JSON format. There are rumours this will be remedied in BizTalk2013R2, unfortunately I required a solution now.

So in the meantime I will use the the Json.NET component to convert the XML message to JSON. I also found this blog from http://blog.quicklearn.com/2013/09/06/biztalk-server-2013-support-for-restful-services-part-45/ to convert XML messages to JSON using the Json.net in a custom pipeline component which I ended up using with some mods.

When using this pipeline remember to set the Outbound HTTP Headers as shown below:

image

This all worked a treat until during the unit testing phase I created a sample XML document with only one repeating element.This caused the following error from the Web API.

Can not deserialize instance…

View original post 614 more words

Advertisements

One thought on “Sending JSON messages from a BizTalk2013 adaptor

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s