How to preprocess bindings file with Carriage Returns for BizTalk

214 Views Asked by At

I have a bindings XML file for BizTalk, the ports are WCF-WebHttp which is basically for calling rest services.

These kind of ports have a HttpHeaders field where you normally put:

Authorization: Basic ThenTHeToken
ContentType: application/json

When check with BizTalk deployment framework and preprocess the bindings,

This is the generated XML, where you can see after the bearer token, there is actually a Line Break

<TransportTypeData>
          &lt;CustomProps&gt;&lt;ServiceCertificate vt="8" /&gt;&lt;HttpMethodAndUrl vt="8"&gt;POST&lt;/HttpMethodAndUrl&gt;&lt;MaxReceivedMessageSize vt="3"&gt;65536&lt;/MaxReceivedMessageSize&gt;&lt;ClientCertificate vt="8" /&gt;&lt;ProxyUserName vt="8" /&gt;&lt;UseAcsAuthentication vt="11"&gt;0&lt;/UseAcsAuthentication&gt;&lt;SuppressMessageBodyForHttpVerbs vt="8" /&gt;&lt;VariablePropertyMapping vt="8"&gt;&amp;lt;BtsVariablePropertyMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /&amp;gt;&lt;/VariablePropertyMapping&gt;&lt;SecurityMode vt="8"&gt;Transport&lt;/SecurityMode&gt;&lt;ProxyToUse vt="8"&gt;Default&lt;/ProxyToUse&gt;&lt;EndpointBehaviorConfiguration vt="8"&gt;&amp;lt;behavior name="EndpointBehavior" /&amp;gt;&lt;/EndpointBehaviorConfiguration&gt;&lt;TransportClientCredentialType vt="8"&gt;None&lt;/TransportClientCredentialType&gt;&lt;OpenTimeout vt="8"&gt;00:01:00&lt;/OpenTimeout&gt;&lt;UseSSO vt="11"&gt;0&lt;/UseSSO&gt;&lt;UseSasAuthentication vt="11"&gt;0&lt;/UseSasAuthentication&gt;&lt;CloseTimeout vt="8"&gt;00:01:00&lt;/CloseTimeout&gt;&lt;SendTimeout vt="8"&gt;00:01:00&lt;/SendTimeout&gt;&lt;HttpHeaders vt="8"&gt;Authorization: Basic bearertoken=
          Content-Type: application/json&lt;/HttpHeaders&gt;&lt;/CustomProps&gt;
        </TransportTypeData>

However when import the bindings into BizTalk application, then on on the output headers, the Line Break is lost, and BizTalk puts both the authorization and content type on the same line, and then it fails.

I can't fix this manually because in the other environments deployment is done automatically via Azure DevOps.

Any idea how to add that line break?

2

There are 2 best solutions below

0
Hichamveo On

I faced the same issue, and I resolve it adding the following separator between headers : WhiteSpace + & # x a; + WhiteSpace in your case :

Authorization: Basic ThenTHeToken & # x a; ContentType: application/json

NB : I added spaces between characters to avoid the decode here

0
venu On
& lt;HttpHeaders vt="8"& gt;X-API-Key: ${XpertDocBulkCNToken} & #xA; Content-Type: application/json& lt;/HttpHeaders& gt;

The above has worked for me.

I have just added the space( ) after each & for the parser to not detect xml.

Even though in the BizTalk Admin console you won't be able to see the new line character, BizTalk is able to sense the 2 HTTP headers and send them.