jackfrost5234
jackfrost5234

Reputation: 229

Multiple URL Parameters with BizTalk WCF-WebHttp Send Port

I'm working with a RESTful API within BizTalk. I need to make a POST against the following endpoint:

http://mycompany.sb01.com/atwork/api/v5.0

I've tested my API Url via Postman with the following(Which works):

http://mycompany.sb01.com/atwork/api/v5.0/UID?name=bob&id=028153

I'm having trouble converting this into a send port in my BizTalk application due to having multiple URL parameters in my POST. When I have the below binding in the BizTalk Admin Console I get a System.ArgumentException which tells me that '=' is an unexpected token and that the expected token is ';'.

<BtsHttpUrlMapping>
<Operation Name="ID Insert" Method="POST" Url= "/UID?name={name}&id={id}"/>
</BtsHttpUrlMapping>

But it only ever works with 1 URL parameter, not multiple ones. If I remove:

&id={id}

from my binding, it goes through without any exceptions. How does BizTalk handle multiple URL parameters?

Upvotes: 1

Views: 1987

Answers (2)

Navdeep Sharma
Navdeep Sharma

Reputation: 21

You need to escape ampersand sign(&) to &amp;
Url in Operation tag should look like this

Url= "/UID?name={name}&amp;id={id}"

Upvotes: 0

Dijkgraaf
Dijkgraaf

Reputation: 11527

You have to escape & in the querystring to &amp;

So it is

<BtsHttpUrlMapping>
    <Operation Name="ID Insert" Method="POST" Url= "/UID?name={name}&amp;id={id}"/>
</BtsHttpUrlMapping>

Upvotes: 6

Related Questions