Complex Global Type Definition and Naming

Within BizTalk Editor, you begin to define a complex global type by defining the first occurrence of the complex type in one of the locations where the global type will be used, after it has been converted to a global type. Continuing with the address example, you might define the complex address type in the course of defining a shipping address within the schema.

After the complex type is defined, you can convert it to a global complex type by giving it a type name. You do this by selecting the node that corresponds to the complex type, which will generally be a Record node, and then typing a new type name into the Data Structure Type property of that node. Although no visible changes occur in the schema tree when you give this property a name (such as, GlobalAddrType, as in the following example), if you examine what happens within the underlying XSD representation of the schema, you would see the following (abbreviated) change.

Before, with the address structure first defined within the context of the ShippingAddress element, the following occurred.

<xs:schema>  
  <xs:element name="Root">  
    <xs:complexType>  
      <xs:sequence>  
        <xs:element name="ShippingAddress">  
        [address structure initially defined here.]  
        </xs:element>  
      </xs:sequence>  
    </xs:complexType>  
  </xs:element>  
</xs:schema>  

After the ShippingAddress node has been given a unique name in its Data Structure Type property, causing it to become available as a complex global type and subject to reuse in multiple places within the schema, the following occurs.

<xs:schema>  
  <xs:element name="Root">  
    <xs:complexType>  
      <xs:sequence>  
        <xs:element name="ShippingAddress" type="GlobalAddrType" />  
      </xs:sequence>  
    </xs:complexType>  
  </xs:element>  
  <xs:complexType name="GlobalAddrType">  
  [address structure now defined globally here.]  
  </xs:complexType>  
</xs:schema>  

See Also

Type Reuse and Derivations
How to Create References to Another Node or Type