Handle Typed Fault Contracts in BizTalk Server 2009

Jul 31 2009

In the BizTalk Server 2009 documentation for the topic How to Handle Typed Fault Contracts in Orchestrations, the documentation assumes the reader is calling a web service based on the SOAP 1.2 specification.  The code sample presented will not work if the user is configuring a WCF Send Adapter to call a web service based on the SOAP 1.1 specification.  When the code sample is used as it is presented against a service based on the SOAP 1.1 specification, the user will most likely see an error like System.InvalidOperationException: Unable to find match for inbound body path expression.  The difference between the two SOAP specifications is in the capitalization of the detail node under the root Fault node.  In order to correctly process both SOAP 1.1 and SOAP 1.2 Faults, the XPath statement in Step 8 of the documentation can be changed from

/*[local-name()='Fault']/*[local-name()='Detail']/* | /*[local-name()='ExpectedResponseMessageType']

to the following statement:

/*[local-name()='Fault']/*[local-name()='Detail' or local-name()='detail']/* | /*[local-name()='ExpectedResponseMessageType'] 

This adjustment enables us to look for a node name of 'detail' (SOAP 1.1) or a node name of 'Detail' (SOAP 1.2) under the 'Fault' node and parse the fault message for the body content that is contained in the SOAP fault.

Tagged: BizTalk, Microsoft, WCF

About the Author

Mike Diiorio's picture

Mike Diiorio is a Lead Consultant and Architect for CapTech Ventures, Inc. Prior to joining the firm in 2001, Mike was the drummer for house bands on board the ships of Premier, Princess and Norwegian Cruise Lines. Mike holds Bachelor degrees in Music Industry and Computer Information Systems from James Madison University. He is a Microsoft Certified Application Developer and has achieved Microsoft Certified Technical Specialist credentials in .NET 2.0 Web Development and BizTalk Server 2006.

Disclaimer

The words and opinions expressed here are those of each article's respective author, and do not necessarily represent the views of CapTech Ventures.