6. BizTalk Document Body

[Previous] [Next]

The <Body> element of the SOAP message that constitutes a BizTalk Document contains the Business Documents being carried. In general, a BizTalk Document may carry a set of related Business Documents (for instance, a purchase order and a shipper's name and address for shipping that order).

Related Business Documents often have shared content. SOAP has a straightforward mechanism for encoding data targeted by multiple references; it uses XML ID attributes and relative URIs. Consider a simple elaboration of the purchase order example above in which both the purchase order and the shipping information reference information about the book. The <Body> element of the following BizTalk Document shows how this could be expressed using SOAP encoding rules.

 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <SOAP-ENV:Header> <!-- headers omitted for brevity --> </SOAP-ENV:Header> <SOAP-ENV:Body> <po:PurchaseOrder xmlns:po="http://electrocommerce.org/purchase_order/"> <po:item href="#theBook"/> <!-- and other purchasing information --> </po:PurchaseOrder> <ship:shippingInfo xmlns:ship="http://electrocommerce.org/shippingInfo/"> <ship:content href="#theBook"/> <!-- and other shipping information --> </ship:shippingInfo> <book xmlns="http://electrocommerce.org/bookInfo/" id="theBook" SOAP-ENC:root="0"> <Title>Essential BizTalk</Title> <!-- and other book information --> </book> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

This example also illustrates a problem that occurs when this technique is used. We would like the destination business entity to view this BizTalk Document as containing two Business Documents: the purchase order and the shipping information. However, the <Body> of the SOAP message contains three child elements. We need a way to distinguish the Business Documents from the elements that appear as direct children of <Body> because they are shared via multiple references.

SOAP provides the SOAP-ENC:root attribute as a method for signaling that an element is not an independent entity. Every immediate child of the <Body> element in a BizTalk Document is a contained Business Document unless that child carries the SOAP-ENC:root attribute with a value of "0".



XML and SOAP Programming for BizTalk Servers
XML and SOAP Programming for BizTalk(TM) Servers (DV-MPS Programming)
ISBN: 0735611262
EAN: 2147483647
Year: 2000
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net