
Specifying How the BizTalk Message Body Is Extracted from an Incoming SOAP Message
You can control how to create the inbound BizTalk message body from the SOAP messages incoming through the WCF adapters. The following figures show the Messages tabs of the WCF-NetNamedPipe receive adapter and send adapter as examples.
To specify how to create the BizTalk message body, select one of the following options in the Inbound BizTalk message body section in the preceding figures:
-
Envelope -- entire <soap:Envelope>. Uses the SOAP Envelope element of an incoming message to create the BizTalk message body part. The entire incoming message becomes the BizTalk message body. Use this option to create the BizTalk message body incorporating all the headers.
Note |
|---|
|
The SOAP headers are placed in the message context, but they are not promoted automatically. Promotion can be done in a custom pipeline component.
|
-
Body -- contents of <soap:Body> element. Uses the content of the SOAP Body element of an incoming message to create the BizTalk message body part. If the Body element has more than one child element, only the first element becomes the BizTalk message body part.
-
Path -- content located by body path. Uses the body path expression in the Body path expression text box to create the BizTalk message body part. The body path expression is evaluated against the immediate child element of the SOAP Body element of an incoming message. When incoming messages have binary data, you can use this option for the BizTalk message body to include only the binary data without any tags.
When the Path -- content located by body path option is selected, the Node encoding property can be configured to specify the expected encoding type for the node specified by the body path expression in the Body path expression text box. If the body path expression matches more than one element, only the first matched element is used.
Note |
|---|
|
For the body path expression property, only the XPath expressions suitable for forward-only processing of XML are supported. For more information about the XPath expressions available for this property, see "The Best of Both Worlds: Combining XPath with the XmlReader" at http://go.microsoft.com/fwlink/?LinkID=75701.
|
If the Path -- content located by body path option is selected and the Node encoding property is set to String, the WCF adapters expect that the matched node has UTF-8 encoded character data. If the incoming messages include escaped character data for the XML special characters such as < and >, the WCF adapters restore the escaped character data when creating the BizTalk message body part. For example, if the matched node has escaped character data such as <FirstName>CONTOSO</FirstName> the WCF adapters create <FirstName>CONTOSO</FirstName> in the inbound BizTalk message body.
If the Path -- content located by body path option is selected and the Node encoding property is set to Hex or Base64, the matched node can have a valid BinHex or Base64 sequence. If the matched node has an invalid sequence, the WCF client receives FaultException, an error message is logged in the event log on your BizTalk Server computer, and no message is suspended.
If the Path -- content located by body path option is selected and the Node encoding property is set to XML, the WCF adapters create the BizTalk message body with the outer XML of the node selected by the body path expression in the Body path expression text box.
If the matched node does not have data encoded as specified in the Node encoding property, an empty inbound BizTalk message body is created.
For example, suppose the WCF send adapters receive the following SOAP message from WCF clients:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://Microsoft.Samples.BizTalk.NetNamedPipe/OrderProcess/IOrderProcess/OrderRefresh</a:Action>
<a:MessageID>urn:uuid:59e74507-66d0-4d50-be70-c3ec248b6f78</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">net.pipe://mycomputer/NetNamedPipeOrderProcessServiceBizTalk</a:To>
</s:Header>
<s:Body>
<Order xmlns="http://Microsoft.Samples.BizTalk.NetNamedPipe/OrderProcess">
<OrderDetail>
<CustomerID>CONTOSO</CustomerID>
<OrderID>00000000</OrderID>
</OrderDetail>
</Order>
</s:Body>
</s:Envelope>
If you configure the Inbound BizTalk message body section as shown in the following table, the previous incoming SOAP message becomes the inbound BizTalk message body part.
|
Inbound BizTalk message body
|
Body path expression
|
Node encoding
|
|---|
|
Envelope -- entire <soap:Envelope>
|
N/A
|
N/A
|
If you configure the BizTalk message body section as shown in the following table, the WCF adapters create the inbound BizTalk message body part to contain only the Order element in the previous incoming SOAP message.
|
Inbound BizTalk message body
|
Body path expression
|
Node encoding
|
|---|
|
Body -- contents of <soap:Body> element
|
N/A
|
N/A
|
If you configure the BizTalk message body section as shown in the following table, the WCF adapters expect that the incoming node that the body path expression matches will have UTF-8 encoded character data.
|
Inbound BizTalk message body
|
Body path expression
|
Node encoding
|
|---|
|
Path -- content located by body path
|
/*[local-name()='Order']/*[local-name()='OrderDetail']/*[local-name()='CustomerID']
|
String
|
For the previous incoming SOAP message, the WCF adapters use the character data, CONTOSO, of the CustomerID element to create the inbound BizTalk message body part.
Note |
|---|
|
You cannot use the abbreviated syntax of XPath, /Order/OrderDetail/CustomerID, for the previous incoming SOAP message. This is because the abbreviated syntax of XPath returns the node not declared in a namespace, and the CustomerID element in the previous SOAP message is declared in the http://Microsoft.Samples.BizTalk.NetNamedPipe/OrderProcess namespace by default namespaces.
|
If you configure the BizTalk message body section as shown in the following table, the CustomID element in the previous incoming SOAP message should have a valid BinHex or Base64 sequence.
|
Inbound BizTalk message body
|
Body path expression
|
Node encoding
|
|---|
|
Path -- content located by body path
|
/*[local-name()='Order']/*[local-name()='OrderDetail']/*[local-name()='CustomerID']
|
Hex or Base64
|
If you configure the BizTalk message body section as shown in the following table, the WCF adapters create the inbound BizTalk message body for the previous incoming SOAP message as shown in the code after the table.
|
Inbound BizTalk message body
|
Body path expression
|
Node encoding
|
|---|
|
Path -- content located by body path
|
/*[local-name()='Order']/*[local-name()='OrderDetail']/*[local-name()='CustomerID']
|
XML
|
<CustomerID xmlns="http://Microsoft.Samples.BizTalk.NetNamedPipe/OrderProcess">CONTOSO</CustomerID>