Schema property promotion and envelop schema

Home Page Forums BizTalk 2004 – BizTalk 2010 Schema property promotion and envelop schema

Viewing 1 reply thread
  • Author
    Posts
    • #22414

      I have this following schema with element ElementB promoted as a message property (by defining a property schema) for routing purpose:

      <SchemaA>
        <ElementB>BLAH1</ElementB>
        <ElementC>BLAH2</ElementC>
      </SchemaA>

      And I also have an envelop schema call <Envelop>.

      I notice that when the message of type SchemaA is received, the property is promoted correctly, and hence the message is routed correctly.

      However when the envelop schema is used, for example the following message is received at the receive port:

      <Envelop>
        <SchemaA>
          <ElementB>BLAH1</ElementB>
          <ElementC>BLAH2</ElementC>
        </SchemaA>
        <SchemaA>
          <ElementB>BLAH3</ElementB>
          <ElementC>BLAH4</ElementC>
        </SchemaA>
        <SchemaA>
          <ElementB>BLAH5</ElementB>
          <ElementC>BLAH6</ElementC>
        </SchemaA>
      <Envelop>

      the message is splitted correctly into 3 different instances, however, the element ElementB was not promoted at all, hence causing a routing failure.

      After a couple hours of trial and error, and I found a solution, which seems to resolve the problem. The solution is to create a map that maps message type SchemaA to same message type SchemaA. Then the map is placed in the received port. Hence, when a message is received with the envelop schema, the message will first decompose into different instances, then each instance will go through the map.

      Although this solution seems to work, it doesn’t look like the best solution because for every instance of message SchemaA, a map is used. Although this might not be an issue for schema with relative simple structure (similar to SchemaA), there will be impact to biztalk server performance if the schema structure becomes more complex.

      Hence, is there a better/simpler solution that can fix this issue? Is it just a simple configuration change somewhere in the biztalk admin console or property of the envelop schema?

      Thank you for your help in advance.

    • #22436

      I tested this scenario successfully i.e. using your Envelop message above I debatched it into 3 SchemaA messages each with the appropriate ElementB field promoted into the header. Here is the schema I used:

       

      <?

       

      xml version=1.0 encoding=utf-16?>
      <
      xs:schema xmlns:ns0=http://GuoMingLi.Properties xmlns:b=http://schemas.microsoft.com/BizTalk/2003 xmlns:xs=http://www.w3.org/2001/XMLSchema>
      <
      xs:annotation>
      <
      xs:appinfo>
      <
      b:imports>
      <
      b:namespace prefix=ns0 uri=http://GuoMingLi.Properties location=.\properties.xsd />
      </
      b:imports>
      <
      b:schemaInfo is_envelope=yes />
      </
      xs:appinfo>
      </
      xs:annotation>
      <
      xs:element name=Envelop>
      <
      xs:annotation>
      <
      xs:appinfo>
      <
      b:recordInfo body_xpath=/*[local-name()=’Envelop’ and namespace-uri()=”] />
      </
      xs:appinfo>
      </
      xs:annotation>
      <
      xs:complexType>
      <
      xs:sequence>
      <
      xs:element maxOccurs=unbounded ref=SchemaA/>
      </
      xs:sequence >
      </
      xs:complexType >
      </
      xs:element >
      <
      xs:element name=SchemaA>
      <
      xs:annotation >
      <
      xs:appinfo >
      <
      b:properties >
      <
      b:property name=ns0:ElementB xpath=/*[local-name()=’SchemaA’ and namespace-uri()=”]/*[local-name()=’ElementB’ and namespace-uri()”] />
      </
      b:properties >
      </
      xs:appinfo >
      </
      xs:annotation>
      <
      xs:complexType >
      <
      xs:sequence>
      <
      xs:element name=ElementB type=xs:string/>
      <
      xs:element name=ElementC type=xs:string/>
      </
      xs:sequence >
      </
      xs:complexType >
      </
      xs:element >
      </
      xs:schema >

       

       

       

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.