Introduction BizTalk Document Schemas

  • Sandro Pereira
  • Jun 13, 2009
  • 3 min read

In BizTalk Server, everything revolves around the message. Whether you are dealing with XML, Flat Files, or JSON (in newer versions), the Document Schema is the core blueprint that defines how data is structured and identified within the engine.

The XML Schema Definition (XSD) language natively defines message structure in BizTalk Server. XML Schemas are the foundation of all scenarios and document exchanges using BizTalk Server. Basically, once you have created your schema, you can create your scenario.

While XML standards are the core of BizTalk messages, a message structure can extend beyond XML to apply to other formats, such as a comma-delimited flat file representation.

Any XSD-compliant XML Editor can define BizTalk messages, but BizTalk Schema Editor supports many of the rich capabilities of XSD, such as importing common schemas to facilitate reuse, …

📝 One-Minute Brief

BizTalk Document Schemas are the foundation of message exchange in BizTalk Server, primarily using XML Schema Definition (XSD). This post provides a foundational guide on how to create schemas in Visual Studio, highlighting the importance of root node naming for message type identification and explaining how to structure nodes using child and sibling elements/attributes.

Creating Document Schemas

  • Create a new BizTalk empty project in Visual Studio.
  • Right-click on the project name and select Add Add New Item;
  • In the Add New Item dialog box, select Schema as the type of the item, type a name, and click Ok.

Now you can define the structure of the document, first you have to change the Root name. You have to understand that this is not necessary, but it’s a common best practice, because BizTalk Server identifies the document (sets a message context property called BTS.MessageType) by making a concatenation of the document namespace and the Root Node Name (Format: Namespace#RootNode). To do that, we need to:

  • Right-click the Root name and select rename;
  • To add nodes, right-click a node and select Insert Schema Node. You can then select from the following options:
    • Child Record, to add a new record
    • Child Field Attribute, to add a new attribute node
    • Sibling Field Attribute, to add a new attribute node
    • Child Field Element, to add a new element node
    • Sibling Field Element, to add a new element node
  • Select the node to view and change its properties

Structuring Your Schema

In the BizTalk Editor, you build your schema by adding different types of nodes:

  • Records: Used to group related data (acts as a container).
  • Field Elements: Standard XML elements for data storage.
  • Field Attributes: Metadata or simple data values associated with a specific record.

Why Naming Matters

One of the most common mistakes beginners make is leaving the Root Node as “Root.” In a production environment with hundreds of schemas, having unique and descriptive Root Names is essential for accurate message routing and tracking.

Creating a schema is only the first step. Once defined, these schemas allow you to map data, validate incoming messages, and route information through orchestrations based on promoted properties.

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top