BizTalk 2010 receiving a JSON message

Hello,

I'm working at integrating BizTalk 2010 with AtTask software.

AtTask provide a ReST API.

To be able to send a ReST request to AtTask, I followed that tutorial:

http://social.technet.microsoft.com/wiki/contents/articles/2474.invoke-restful-web-services-with-biztalk-server-2010.aspx.

I'm using a WCF-Custom send-receive port, with wsHttpBinding and an endpoint Behavior.

So far, I'm able to send a login request and receiving a successful response. The problem is processing the response.

I was expecting to receive a JSON, but BizTalk is somewhere converting the response into an Xml message:

This is the response as AtTask send it (got it from Fidler):

{
  "userID": "52dfde40003301510c06558a1f246ef4",
  "sessionID": "fe1a78987d46406c9c1e77372423ebda",
  "versionInformation": {
    "currentAPI": "v4.0",
    "buildNumber": "db9b275ad4c1587951a99d83856631d9590a6781",
    "apiVersions": {
      "v1.0": "/attask/api/v1.0/",
      "v2.0": "/attask/api/v2.0/",
      "v3.0": "/attask/api/v3.0/",
      "v4.0": "/attask/api/v4.0/"
    },
    "lastUpdated": "2014/01/21 13:21:24",
    "release": "R16",
    "version": "4.0"
  },
  "locale": "en_US",
  "timeZone": "US/Pacific",
  "timeZoneName": "Pacific Standard Time",
  "iso3Country": "USA",
  "iso3Language": "eng",
  "currency": {
    "useNegativeSign": false,
    "fractionDigits": 2,
    "symbol": "$",
    "ID": "USD",
    "groupingSeparator": ",",
    "decimalSeparator": "."
  }
}

This is what I get in BizTalk:

<root type="object">
	<data type="object">
		<userID type="string">52dfde40003301510c06558a1f246ef4</userID>
		<sessionID type="string">0294fb6dee9f40d383488ac15ebcddd7</sessionID>
		<versionInformation type="object">
			<currentAPI type="string">v4.0</currentAPI>
			<buildNumber type="string">db9b275ad4c1587951a99d83856631d9590a6781</buildNumber>
			<apiVersions type="object">
				<v1.0 type="string">/attask/api/v1.0/</v1.0>
				<v2.0 type="string">/attask/api/v2.0/</v2.0>
				<v3.0 type="string">/attask/api/v3.0/</v3.0>
				<v4.0 type="string">/attask/api/v4.0/</v4.0>
			</apiVersions>
			<lastUpdated type="string">2014/01/21 13:21:24</lastUpdated>
			<release type="string">R16</release>
			<version type="string">4.0</version>
		</versionInformation>
		<locale type="string">en_US</locale>
		<timeZone type="string">US/Pacific</timeZone>
		<timeZoneName type="string">Pacific Standard Time</timeZoneName>
		<iso3Country type="string">USA</iso3Country>
		<iso3Language type="string">eng</iso3Language>
		<currency type="object">
			<useNegativeSign type="boolean">false</useNegativeSign>
			<fractionDigits type="number">2</fractionDigits>
			<symbol type="string">$</symbol>
			<ID type="string">USD</ID>
			<groupingSeparator type="string">,</groupingSeparator>
			<decimalSeparator type="string">.</decimalSeparator>
		</currency>
	</data>
</root>

If I keep the Xml format, I'll have to define an xsd for each possible response from AtTask, and have a specific logical for each in my orchestration.

I want to process the JSON myself (AtTask provide library for that).

I tried to specify Content-Type=application/json and Accept=application/json, in the custom behavior extension (IClientMessageInspector BeforeSendRequest/AfterReceiveReply), but It doesn't work.

I have debugged the process, and when I arrive in the AfterReceiveReply, the JSON is already transformed in Xml.

So, my question is, is it possible to tel BizTalk not to transform the message he receives into Xml?

Thanks


January 28th, 2014 7:27pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics