Search code examples
arraysrestquery-stringbiztalk

How can I get BizTalk to allow a large array in querystring for consuming a REST service?


My problem is that I want to consume a REST service that have an array as input parameter, and I have a lot of items in the array (about 2 500 characters in total, which is allowed by HTTP protocol).

I tried using a dynamic send port and set BaseAddress or the parameter Url in BtsHttpUrlMapping programmatically. BaseAddress just allows 256 characters, so that is not an option and BtsHttpUrlMapping validates the parameter Url and won't allow same name more than ones (arrays in querystring is repeating the same name (which also is allowed) ?arrayName=1&arrayName=27 and so on).

Do anyone have had this problem and solved it?

If no one have a solution my next step is to split each item in the array, call the service for each one and aggregate the results back into one response :)


Solution

  • The problem was solved when getting in contact with the developer of the API. I did not know we hade control of it, but it was an internal "facade" and the developer added a resource that took the array in the body as POST. Then BizTalk had no limitation in calling the API.

    So keep in mind that BizTalk doesn't allow more than 256 characters in the XLANG.BaseAddress and doesn't allow repeating names in the querystring/BtsHttpUrlMapping, which I can understand in one way, but Microsoft could have added support for it too. Instead of just mapping Promoted properties (that can only occur once), they could have supported XPath (to a record).