Jeremy
Jeremy

Reputation: 46350

BizTalk Xml disassembler not promoting properties

I have defined a schema with several promoted properties.

I have a two way send port that calls a rest service.
The rest service returns a response matching the message schema. The receive pipeline for the two way send port has an xml disassembler component in it.

enter image description here

I also have a two way receive port. The receive pipeline of the receive port has a component that publishes multiple messages into the queue so they are available using the GetNext() function. One of the messages matches the schema I published. The next component in the pipeline is an xml disassembler component.

enter image description here

I would have thought that in both ports, because my receive port has an xml disassembler, it would publish the promoted properties of the message so that I can subscribe to them in send ports, The values are not being promoted and I don't know why that is.

Here is my message schema:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://MyMessage" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ns0="https://MyMessageProperties.PropertySchema" targetNamespace="http://MyMessage" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <b:imports xmlns:b="http://schemas.microsoft.com/BizTalk/2003">
        <b:namespace prefix="ns0" uri="https://MyMessageProperties.PropertySchema" location=".\PropertySchema.xsd" />
      </b:imports>
    </xs:appinfo>
  </xs:annotation>
  
  <xs:element name="MessageProcessingResult">
    <xs:annotation>
      <xs:appinfo>
        <b:properties>
          <b:property name="ns0:Category" xpath="/*[local-name()='MessageProcessingResult' and namespace-uri()='http://MyMessage']/*[local-name()='Category' and namespace-uri()='']" />
          <b:property name="ns0:Code" xpath="/*[local-name()='MessageProcessingResult' and namespace-uri()='http://MyMessage']/*[local-name()='Code' and namespace-uri()='']" />
          <b:property name="ns0:ComponentOfOrigin" xpath="/*[local-name()='MessageProcessingResult' and namespace-uri()='http://MyMessage']/*[local-name()='ComponentOfOrigin' and namespace-uri()='']" />
          <b:property name="ns0:OriginalMessageTypeValue" xpath="/*[local-name()='MessageProcessingResult' and namespace-uri()='http://MyMessage']/*[local-name()='OriginalMessageType' and namespace-uri()='']/*[local-name()='Value' and namespace-uri()='']" />
          <b:property name="ns0:OriginalMessageID" xpath="/*[local-name()='MessageProcessingResult' and namespace-uri()='http://MyMessage']/*[local-name()='OriginalMessageID' and namespace-uri()='']" />
        </b:properties>
      </xs:appinfo>
    </xs:annotation>
    
    <xs:complexType>
      <xs:all>
        <xs:element name="Category">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="Success" />
              <xs:enumeration value="Problem" />
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element name="Code" type="xs:string" />
        <xs:element name="ComponentOfOrigin" type="xs:string" />
        <xs:element name="OriginalMessageID" type="xs:string" />
        <xs:element name="OriginalMessageType" type="Type" />        
      </xs:all>
    </xs:complexType>
  </xs:element>
  
  <xs:complexType name="Type">
    <xs:all>
      <xs:element minOccurs="1" maxOccurs="1" name="Value" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Name" type="xs:string" />
    </xs:all>
  </xs:complexType>
  
</xs:schema>

Here is my property schema:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://MyMessageProperties.PropertySchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="https://MyMessageProperties.PropertySchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <b:schemaInfo schema_type="property" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element default="Problem" name="Category" type="xs:string">
    <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo propertyGuid="676ad92f-16de-42df-8758-6b92dc4816a6" />
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
  <xs:element default="Unkown" name="Code" type="xs:string">
    <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo propertyGuid="74bf0ac9-fe44-4ef1-a27c-64afe0e334bb" />
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
  <xs:element default="Unknown" name="ComponentOfOrigin" type="xs:string">
    <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo propertyGuid="860e8876-8a0e-4fbd-aebe-84ee12bfb041" />
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
  <xs:element default="00000000-0000-0000-0000-000000000000" name="OriginalMessageTypeValue" type="xs:string">
    <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo propertyGuid="4d329f1d-4944-46e0-9ec9-4b87eb8d7a71" />
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
  <xs:element default="00000000-0000-0000-0000-000000000000" name="OriginalMessageID" type="xs:string">
    <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo propertyGuid="5bc4a75a-8fb3-4b54-becc-89e5415d216d" />
      </xs:appinfo>
    </xs:annotation>
  </xs:element>
</xs:schema>

Upvotes: 0

Views: 247

Answers (1)

Dijkgraaf
Dijkgraaf

Reputation: 11527

The issue is that only ONE dissembler will execute.

Notice the graphics in the Disassemble stage vs the Decode stage.

enter image description here

The Decode components will fire in sequence, but the Disassemble stage will probe which component matches the message, and the first one that matches will fire, and only that one.

Pipelines (Microsoft)

As an example of execution modes, the Disassemble stage of a receive pipeline is a First Match stage, thus each component in the stage is called to see if it recognizes the message and can process it. If the component responds in the affirmative, then no other components in that stage are queried to see if they can also handle the message. However, the Decode stage of a receive pipeline has an execution mode of All, meaning that each component in this stage is called to process the message in the order in which they were configured. The first decoder might be to decrypt the message, while the second might be to decompress the message from a zipped format.

So if you want to promote properties and also de-batch, you need to do in both your custom Disassembler.

e.g.

outMsg.Context.Promote(Name, Namespace, PropertyValue);

Upvotes: 2

Related Questions