BizTalk Development Series (17) Envelope architecture (Envelop)

Source: Internet
Author: User
Tags biztalk

For more information, see the BizTalk hands-on experiment series directory.

BizTalk Development Series

Using the envelope architecture during the development of BizTalk can improve BizTalk processing performance. For example, when using the SQL Adapter, you can use an envelope to select multiple records and split the XML message part of the envelope into separate messages and publish them to MessageBox. BizTalk creates multiple processing instances to process these messages. Reduce the interactions between the SQL Adapter and the database.

 What is envelope architecture?

Microsoft officially defines the envelope architecture as follows:Envelope architecture is a special type of XML Architecture. (Not defined by W3C) the envelope architecture is used to define the structure of an XML envelope to wrap one or more XML business documents into a single XML instance message. When defining an XML architecture as an envelope architecture, multiple root records are defined based on whether they are in the envelope architecture. Other attribute settings may be required.

How to create an envelope architecture?

In most cases, the envelope architecture is a simple XML architecture. Because the contents of the envelope are to be deleted during XML disassembly and assembly. Of course, in addition to the upgrade attribute of the envelope and the distinguished field, it will be upgraded to the context of the message and inherited by the individual messages in the envelope. The first few steps before creating an envelope architecture in the BizTalk Schema compiler are the same as creating a common architecture, but you only need to set relevant attributes. Specifically:

Create a Schema. Click <Schema> set Envelop attribute to Yes in attribute settings. Set "body Xpath" in the envelope Root (Root ". If there are multiple root in the architecture and no root reference is set, you need to set "body Xpath" for each root ". If the architecture has multiple roots and the root reference is set, set "body Xpath" for the root ". Other root types are optional.

Generally, select a node in the "body Xpath" Setting Dialog Box to automatically generate the corresponding Xpath expression. If the automatic generation function cannot meet your needs, you can manually enter an Xpath expression.

Envelope Disassembly

Envelope disassembly occurs in the receiving pipeline disassembly phase by using the XML loader. The XML disassembling Pipeline component combines the XML parsing and disassembling functions into one component. The main functions of this component are as follows:

  • Delete an envelope.
  • Disassemble the message body based on the predefined Xpath.
  • Upgrade the distinguished fields and attributes of the envelope to the Message context.

After receiving the message, the disassembling tool performs static parsing by using the architecture associated with the component specified at design time, or by running according to the Message Type (Namespace # RootName) determine the envelope architecture for dynamic parsing. The architecture is used to verify the message structure during envelope resolution. If no architecture structure is defined, you can use the root node namespace and base name to find the architecture, so as to recursively determine the message architecture.

If there is only one architecture that matches the message, the disassemble reads the annotation content of the architecture, as shown below. (More information may be read in the actual process)

<Xs: appinfo> <B: schemaInfo is_envelope = "yes" xmlns: B = "http://schemas.microsoft.com/BizTalk/2003"/>

The architecture annotation specifies that the message is an envelope schema. The Disassembling uses a predefined XPath (encoded as an annotation in the XSD architecture associated with the envelope and message) to extract content attributes from the envelope and message instance. This component parses each document in the envelope. For each document, the BizTalk message object is created using its own context. All attributes upgraded from the envelope and the document itself are copied from this context.

<Xs: element name = "Root">
<Xs: annotation>
<Xs: appinfo>
<B: recordInfo body_xpath = "/* [local-name () = 'root' and namespace-uri () = 'HTTP: // SchemasAPP. envelopscheme']/* [local-name () = 'enabledbody' and namespace-uri () = '']"/>

The Recoverable Interchange Processing attribute of the disassembling tool indicates that if the value is True, all messages in the envelope can be processed only when the message architecture is unique, otherwise, all messages are suspended. If the value is False, only messages that cannot find the message architecture will be processed if other messages are mounted. (This function is not only for envelope messages !)

 

References:Microsoft BizTalk 2006 Help

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.