Biztalk Development Series (17) Envelope architecture (envelop)

Source: Internet
Author: User
Tags xpath biztalk

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 the 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 !)

Biztalk Development Series (17) Envelope architecture (envelop)

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.