Search code examples
wcfbiztalkbiztalk-2013

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?


Solution

  • 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>