Invalid PortBindings.xml file

Topics: Bindings File, Settings Management and SSO
Sep 3, 2009 at 4:04 PM

Hi,

First off, thanks for an awesome deployment framework! You guys rock!

I'm encountering a few problems importing the generated bindings (PortBindings.xml) obtained after xml pre-processing of my PortBindingsMaster.xml. While the correct substitutions for transport locations and the like are being made as per the selected environment (as obtained from SettingsFileGenerator.xml) the resulting PortBindings.xml is invalid. For some reason other parts of the file are being modified. Specifically all < and > tags in the binding xml are being replaced with &amplt; and &ampgt; respectively which is obviously wrong. Thus BizTalk complains when importing the bindings saying invalid or malformed xml.

The specific elements affected are <TransportTypeData/> for send ports and <ReceiveLocationTransportTypeData/> for receive locations.

Any idea what's wrong?

Regards,

Jimit

 

Coordinator
Sep 3, 2009 at 11:06 PM

Hi Jimit,

Thanks much for the positive comments!  Have you fully prepared your PortBindingsMaster.xml for pre-processing?  After you export the bindings XML, you need to prepare it to be a "master" file by unencoding most sections where the binding XML contains embedded XML.  For instance, the TransportTypeData section contains embedded XML.  In your master file, the embedded XML there should be changed from &lt; back to <, &amp; back to &, and so on.  You can do this manually, or you can try it by running the ElementTunnel.exe utility from the DeployTools folder at a command prompt.  You'll find a complete list of elements that are XML-encoded during preprocessing in the AdapterXPaths.txt file in the DeployTools subfolder.  Each of the listed sections should appear un-encoded in your master file.  Note that the version of AdapterXPaths.txt that is available from the Source Code tab is newer than the one included in the currently posted beta download.

Please see the included sample solution's master binding file for an example.

Thanks,
Tom

Sep 4, 2009 at 1:39 PM

First I want to congratulate you with this great piece of functionality.

At the moment I'm integrating it into the BizTalk Software Factory and I'm using it on a project.

The reason I comment here is because in the project I'm experiencing exactly the same. I've used ElementTunnel.exe to convert the decode the binding file and put the result in the PortbindingsMaster.xml.

If I look at what shows up in the Portbindings.xml then it looks like there is too much encoded.

I put in this in the PortbindingsMaster.xml for some custom pipeline:

          <ReceivePipelineData>
            <Root>
              <Stages>
And it shows up like this in Portbindings.xml:
<ReceivePipelineData>&amp;lt;Root&amp;gt;&amp;lt;Stages
I think the &amp; in front shouldn't be there but since I just started with the BTDF I'm not sure.
Coordinator
Sep 4, 2009 at 10:10 PM

<ReceivePipelineData> is one of those elements that I referred to above, where an element's value is XML that must be encoded.  You are seeing the correct result.

Here is the current list of all XPaths used to encode content in the master binding file (ORDER DOES MATTER):

/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ReceiveLocationTransportTypeData/CustomProps/AdapterConfig
/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ReceiveLocationTransportTypeData/CustomProps/BindingConfiguration
/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ReceiveLocationTransportTypeData
/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ReceivePipelineData
/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/SendPipelineData

/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData/CustomProps/StaticAction
/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData/CustomProps/AdapterConfig
/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData/CustomProps/BindingConfiguration
/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData
/BindingInfo/SendPortCollection/SendPort/ReceivePipelineData
/BindingInfo/SendPortCollection/SendPort/SendPipelineData

/BindingInfo/PartyCollection/Party/CustomData

In some cases double-encoding is happening.  For instance, you'll see that the XML in TransportTypeData/CustomProps/StaticAction is going to be encoded, and then the XML in parent TransportTypeData is also going to be encoded, so you could see double-encoding deep inside of TransportTypeData such as &amp;lt;.

The best way to start from a known good point is always to fully manually configure your bindings with BizTalk Admin the very first time and get the app started.  Then, export the complete binding file so that you have a reference point for how the XML encoding must result after our preprocessing.

Tom