Configuring WSS and FTP Ports in the Port Binding Master File

Topics: Bindings File, Settings Management and SSO
Aug 20, 2009 at 11:28 PM

 Hi Guys,

 I need a few pointers regarding the correct format for setting up Send and Receive Port definitions in the Port Bindings Master File for Adpaters such as WSS and FTP that have a fairly extensive set of properties in the TransportTypeData element of the port definition.

 Shown below is an example of one particular Send Port (annonymised) that I need to setup, in this case for a WSS Form Library:

 <SendPort Name="MyApp_1.0_UserPortalWSSSendPort" IsStatic="true" IsTwoWay="false" BindingOption="0">
      <Description xsi:nil="true" />
      <TransmitPipeline Name="Microsoft.BizTalk.DefaultPipelines.XMLTransmit" FullyQualifiedName="Microsoft.BizTalk.DefaultPipelines.XMLTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="2" TrackingOption="ServiceStartEnd MessageSendReceive PipelineEvents" Description="" />
      <PrimaryTransport>
        <Address>wss://myserver:8080/MyApp/Data%20Requests</Address>
        <TransportType Name="Windows SharePoint Services" Capabilities="15371" ConfigurationClsid="ba7dad66-5fc8-4a24-a27e-d9f68fd67c3a" />
        <TransportTypeData>&lt;CustomProps&gt;&lt;AdapterConfig vt="8"&gt;&amp;lt;SendPort xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&amp;gt;&amp;lt;SiteUrl&amp;gt;http://myserver:8080/MyApp/&amp;lt;/SiteUrl&amp;gt;&amp;lt;WssLocation&amp;gt;Data Requests&amp;lt;/WssLocation&amp;gt;&amp;lt;Overwrite&amp;gt;no&amp;lt;/Overwrite&amp;gt;&amp;lt;NamespaceAliases&amp;gt;&amp;lt;/NamespaceAliases&amp;gt;&amp;lt;FileName&amp;gt;%Filename%.xml&amp;lt;/FileName&amp;gt;&amp;lt;OfficeIntegration&amp;gt;optional&amp;lt;/OfficeIntegration&amp;gt;&amp;lt;TemplatesDocLib&amp;gt;&amp;lt;/TemplatesDocLib&amp;gt;&amp;lt;TemplatesNamespaceCol&amp;gt;&amp;lt;/TemplatesNamespaceCol&amp;gt;&amp;lt;CustomTemplatesDocLib&amp;gt;&amp;lt;/CustomTemplatesDocLib&amp;gt;&amp;lt;CustomTemplatesNamespaceCol&amp;gt;&amp;lt;/CustomTemplatesNamespaceCol&amp;gt;&amp;lt;PropertyName1&amp;gt;&amp;lt;/PropertyName1&amp;gt;&amp;lt;PropertySource1 /&amp;gt;&amp;lt;PropertyName2&amp;gt;&amp;lt;/PropertyName2&amp;gt;&amp;lt;PropertySource2 /&amp;gt;&amp;lt;PropertyName3&amp;gt;&amp;lt;/PropertyName3&amp;gt;&amp;lt;PropertySource3 /&amp;gt;&amp;lt;PropertyName4&amp;gt;&amp;lt;/PropertyName4&amp;gt;&amp;lt;PropertySource4 /&amp;gt;&amp;lt;PropertyName5&amp;gt;&amp;lt;/PropertyName5&amp;gt;&amp;lt;PropertySource5 /&amp;gt;&amp;lt;PropertyName6&amp;gt;&amp;lt;/PropertyName6&amp;gt;&amp;lt;PropertySource6 /&amp;gt;&amp;lt;PropertyName7&amp;gt;&amp;lt;/PropertyName7&amp;gt;&amp;lt;PropertySource7 /&amp;gt;&amp;lt;PropertyName8&amp;gt;&amp;lt;/PropertyName8&amp;gt;&amp;lt;PropertySource8 /&amp;gt;&amp;lt;PropertyName9&amp;gt;&amp;lt;/PropertyName9&amp;gt;&amp;lt;PropertySource9 /&amp;gt;&amp;lt;PropertyName10&amp;gt;&amp;lt;/PropertyName10&amp;gt;&amp;lt;PropertySource10 /&amp;gt;&amp;lt;PropertyName11&amp;gt;&amp;lt;/PropertyName11&amp;gt;&amp;lt;PropertySource11 /&amp;gt;&amp;lt;PropertyName12&amp;gt;&amp;lt;/PropertyName12&amp;gt;&amp;lt;PropertySource12 /&amp;gt;&amp;lt;PropertyName13&amp;gt;&amp;lt;/PropertyName13&amp;gt;&amp;lt;PropertySource13 /&amp;gt;&amp;lt;PropertyName14&amp;gt;&amp;lt;/PropertyName14&amp;gt;&amp;lt;PropertySource14 /&amp;gt;&amp;lt;PropertyName15&amp;gt;&amp;lt;/PropertyName15&amp;gt;&amp;lt;PropertySource15 /&amp;gt;&amp;lt;PropertyName16&amp;gt;&amp;lt;/PropertyName16&amp;gt;&amp;lt;PropertySource16 /&amp;gt;&amp;lt;Timeout&amp;gt;100000&amp;lt;/Timeout&amp;gt;&amp;lt;AdapterWSPort&amp;gt;80&amp;lt;/AdapterWSPort&amp;gt;&amp;lt;uri&amp;gt;wss://myserver:8080/MyApp/Data%20Requests&amp;lt;/uri&amp;gt;&amp;lt;/SendPort&amp;gt;&lt;/AdapterConfig&gt;&lt;/CustomProps&gt;</TransportTypeData>
        <RetryCount>3</RetryCount>
        <RetryInterval>5</RetryInterval>
        <ServiceWindowEnabled>false</ServiceWindowEnabled>
        <FromTime>2009-08-15T23:00:00</FromTime>
        <ToTime>2009-08-16T22:59:59</ToTime>
        <Primary>true</Primary>
        <OrderedDelivery>false</OrderedDelivery>
        <DeliveryNotification>1</DeliveryNotification>
        <SendHandler Name="MyAppWSSSendHost" HostTrusted="false">
          <TransportType Name="Windows SharePoint Services" Capabilities="15371" ConfigurationClsid="ba7dad66-5fc8-4a24-a27e-d9f68fd67c3a" />
        </SendHandler>
      </PrimaryTransport>
      <SecondaryTransport>
        <Address />
        <RetryCount>3</RetryCount>
        <RetryInterval>5</RetryInterval>
        <ServiceWindowEnabled>false</ServiceWindowEnabled>
        <FromTime>2009-08-15T23:00:00</FromTime>
        <ToTime>2009-08-16T22:59:59</ToTime>
        <Primary>false</Primary>
        <OrderedDelivery>false</OrderedDelivery>
        <DeliveryNotification>1</DeliveryNotification>
        <SendHandler xsi:nil="true" />
      </SecondaryTransport>
      <ReceivePipelineData xsi:nil="true" />
      <Tracking>0</Tracking>
      <Filter>&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;Group&gt;
    &lt;Statement Property="BTS.MessageType" Operator="0" Value="http://mycompany.com/MyApp/schemas/canonical/datarequest/1.0#Canonical_datarequest" /&gt;
    &lt;Statement Property="MyApp.Schemas.Canonical.datarequestStatus" Operator="0" Value="AwaitingManualApproval" /&gt;
  &lt;/Group&gt;
  &lt;Group&gt;
    &lt;Statement Property="BTS.MessageType" Operator="0" Value="http://mycompany.com/MyApp/schemas/canonical/datarequest/1.0#Canonical_datarequest" /&gt;
    &lt;Statement Property="MyApp.Schemas.Canonical.datarequestStatus" Operator="0" Value="AwaitingManualProductAmendment" /&gt;
  &lt;/Group&gt;
  &lt;Group&gt;
    &lt;Statement Property="BTS.MessageType" Operator="0" Value="http://mycompany.com/MyApp/schemas/canonical/datarequest/1.0#Canonical_datarequest" /&gt;
    &lt;Statement Property="MyApp.Schemas.Canonical.datarequestStatus" Operator="0" Value="AwaitingManualPricingAmendment" /&gt;
  &lt;/Group&gt;
  &lt;Group&gt;
    &lt;Statement Property="BTS.MessageType" Operator="0" Value="http://mycompany.com/MyApp/schemas/canonical/datarequest/1.0#Canonical_datarequest" /&gt;
    &lt;Statement Property="MyApp.Schemas.Canonical.datarequestStatus" Operator="0" Value="Stored" /&gt;
  &lt;/Group&gt;
&lt;/Filter&gt;</Filter>
      <Transforms />
      <OrderedDelivery>false</OrderedDelivery>
      <Priority>5</Priority>
      <StopSendingOnFailure>false</StopSendingOnFailure>
      <RouteFailedMessage>false</RouteFailedMessage>
      <ApplicationName>MyApp_1.0</ApplicationName>
    </SendPort>

I'm struggling with exactly how to convert the escaped XML in these port definitions into a format that the framework will process. File ports are fairly straight forward, but Adapter types such as WSS and FTP seem a little more of a challenge due to all the butt-ugly escaped XML involved. As you can see for this Send Port the escaped XML is at two levels and in the inner section even the escaped XML is itself escaped - see the '&amp;' instead of '&'...nasty!

As an aside, I assume the Filter Expression is left as-is?

I'm looking to control the: SiteUrl, WssLocation, FileName, AdapterWSPort and Uri properties through the environment spreadsheet.

 Any help is gratefully received...

Aug 21, 2009 at 11:02 AM

Hi Guys,

Further to my initial posting I've done some investigations around ElementTunnel.exe (I'd forgotten this existed - information overload and my Brain ran out of RAM! - and was reminded about it in a chat with JMcLay).

Armed with this extra info my Googling proved more fruitful and I discovered a posting by Scott from 4 years ago around this (http://www.traceofthought.net/PermaLink,guid,640d3834-9574-4eb1-bca2-e38b78284e63.aspx).

Following his instructions there I used ElementTunnel to Unescape the Binding File exported from BizTalk. I used his suggested XPaths:

/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ ReceiveLocationTransportTypeData
/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ ReceiveLocationTransportTypeData/CustomProps/AdapterConfig
/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData
/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData/CustomProps/AdapterConfig

The end result of this process (at this point I didn't apply any of the conditional logic to make addresses, etc. environment specific) appeared to work  when used to deploy from VS.NET - ran without error.

However, on closer inspection within the BizTalk Administration Console it was apparent that there were problems with the WSS Send & Receive Ports and the FTP Receive Ports. When you pressed the 'Configure' button in the Properties dialog for each of them BizTalk popped up an 'Out of Memory' error and when the dialog finally opened none of the relevant properies were set. Once set manually everything was fine.

Clealry there is some problem with the end product of ElementTunnel as I have it configured.

When you look at the newly generated PortBindings Master File you can see that the escaped XML of the ReceiveLocationTransportTypeData record has been partially escaped - CustomProps and AdapterConfig have been unescaped (which is as defined in the XPaths).

Clearly BizTalk does not like the remaining escaped XML in the ReceiveLocationTransportTypeData record.

So my question is, just how much of this escaped XML should actually be unescaped? Should it be all of it or is there something else that I am missing?

Also, am I right in thinking that Filter expressions have to remain as escaped XML?

Thanks in anticiaption.

Coordinator
Aug 21, 2009 at 3:48 PM
Have you tried taking the "raw" bindings file (as exported from BizTalk admin console), and then applying ElementTunnel.exe in both directions (unescape, then escape), and then doing a diff?

I've found that this is helpful to identify whether there are additional xpaths needed, given the serialization details of a particular adapter.

(It would be have been a very good thing for BizTalk to simply have declared this portion of the binding file schema open, rather than forcing escaped xml into the mix...)

On Fri, Aug 21, 2009 at 6:02 AM, RedDwarf <notifications@codeplex.com> wrote:

From: RedDwarf

Hi Guys,

Further to my initial posting I've done some investigations around ElementTunnel.exe (I'd forgotten this existed - information overload and my Brain ran out of RAM! - and was reminded about it in a chat with JMcLay).

Armed with this extra info my Googling proved more fruitful and I discovered a posting by Scott from 4 years ago around this (http://www.traceofthought.net/PermaLink,guid,640d3834-9574-4eb1-bca2-e38b78284e63.aspx).

Following his instructions there I used ElementTunnel to Unescape the Binding File exported from BizTalk. I used his suggested XPaths:

/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ ReceiveLocationTransportTypeData
/BindingInfo/ReceivePortCollection/ReceivePort/ReceiveLocations/ReceiveLocation/ ReceiveLocationTransportTypeData/CustomProps/AdapterConfig
/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData
/BindingInfo/SendPortCollection/SendPort/*/TransportTypeData/CustomProps/AdapterConfig

The end result of this process (at this point I didn't apply any of the conditional logic to make addresses, etc. environment specific) appeared to work  when used to deploy from VS.NET - ran without error.

However, on closer inspection within the BizTalk Administration Console it was apparent that there were problems with the WSS Send & Receive Ports and the FTP Receive Ports. When you pressed the 'Configure' button in the Properties dialog for each of them BizTalk popped up an 'Out of Memory' error and when the dialog finally opened none of the relevant properies were set. Once set manually everything was fine.

Clealry there is some problem with the end product of ElementTunnel as I have it configured.

When you look at the newly generated PortBindings Master File you can see that the escaped XML of the ReceiveLocationTransportTypeData record has been partially escaped - CustomProps and AdapterConfig have been unescaped (which is as defined in the XPaths).

Clearly BizTalk does not like the remaining escaped XML in the ReceiveLocationTransportTypeData record.

So my question is, just how much of this escaped XML should actually be unescaped? Should it be all of it or is there something else that I am missing?

Also, am I right in thinking that Filter expressions have to remain as escaped XML?

Thanks in anticiaption.

Read the full discussion online.

To add a post to this discussion, reply to this email (biztalkdeployment@discussions.codeplex.com)

To start a new discussion for this project, email biztalkdeployment@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
scott colestock
612.559.0580
Coordinator
Aug 21, 2009 at 7:31 PM

This is always one of those things that I have to play with myself to get everything just right.  The trouble is the variability of the XML from adapter to adapter.  I've been adding to our auto-encoding list as I stumble over these cases myself, but I'm sure there are still more that I haven't found.

The adapterXPaths.txt file in Framework\DeployTools controls what is re-encoded automatically by ElementTunnel.exe, and the sequence matters because often there is a block of XML that needs to be encoded, then included in another block of XML which is itself encoded.

I just now checked in some additional XPaths to the file in CodePlex.  This is the current list (and you can paste this into your adapterXPaths.txt if you'd like):

/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

We cannot do <Filter> automatically because it includes the <?xml> declaration -- although BizTalk might successfully load it without the <?xml> declaration.  I haven't tried.  You could give that a shot by adding /BindingInfo/SendPortCollection/SendPort/Filter to the list.

You should be able to un-encode nearly everything in your binding file (other than Filter).  I typically do the unencoding manually with "replace in selection", but that's out of habit as much as anything.

Hope that helps.

Tom

Oct 8, 2009 at 11:35 AM

It is possible to add /BindingInfo/SendPortCollection/SendPort/Filter to the list.... but you will have to change the contents a bit, otherwise you get Microsoft.BizTalk.ExplorerOM errors when starting the port. The <?xml> declaration must be removed.

Empty filters in the PortBindingMaster must be entered like this:

<Filter>
 <Filter/>
</Filter>

And an active filter may look like this:

<Filter>
 <Filter>
  <Group>
   <Statement Property="BTS.MessageType" Operator="0" Value="http://schemas#RootNode" />
  </Group>
 </Filter>
</Filter>

Hugo

Coordinator
Oct 14, 2009 at 5:37 AM

Hugo, thank you for posting this follow-up.  Good to know that <Filter> still works fine after stripping out the <?xml> declaration.

Tom