Hi
I'm having trouble extracting SOAPFault Code and Reson values (string) in an orchestration, thrown by a java web service (SOAP 1.2).
Steps:
- Send port is configured with Propagate Fault Message = true
- I'm using a Scope and Catch-shape to catch BTS.soap_envelope_1__2.Fault (variable sf)
- When BTS.soap_envelope_1__2.Fault is cought (I see that it is, in the event viewer), since sf is a variable, I create a new message of type BTS.soap_envelope_1__2.Fault (also tried with message of type XmlDocument) and make it equal to sf (msgSoapFault = sf;). I also confirmed that msgSoapFault contains the same value as sf since I studied it in my debug output.
- I use following expression to extract Code and Reason from msgSoapFault:
strSoapFaultCode = xpath(msgSoapFault, "/*[local-name()='Fault' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/*[local-name()='Code' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/*[local-name()='Value' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/text()");
strSoapFaultReason = xpath(msgSoapFault, "/*[local-name()='Fault' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/*[local-name()='Reason' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/*[local-name()='Text' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/text()");
In my debug output I see that strSoapFaultCode and strSoapFaultReason are empty. The orchestration also throws NullReferenceException since I'm trying to compare strSoapFaultCode with a string: strSoapFaultCode.Contains("soap:Sender").
I know that my XPath is correct, I have tested it against the SOAPFault message manually. This is the SOAPFault that I catch in step 2:
<soap:Fault xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Code> <soap:Value>soap:Sender</soap:Value> <soap:Subcode> <soap:Value>IllegalString</soap:Value> </soap:Subcode> </soap:Code> <soap:Reason> <soap:Text xml:lang="en">Random text</soap:Text> </soap:Reason> </soap:Fault>
Notes: The whole process is an exact replica of post http://masteringbiztalkserver.wordpress.com/2010/11/21/catching-soap-faults-from-wcf-service-in-biztalk-orchestration/.
I have also studied forum post at http://social.msdn.microsoft.com/Forums/en-US/d8d771bf-cc81-4f22-b19c-a01bbe5f5a1d/how-to-catch-and-process-soap-faults-when-consuming-wcf-service-in-orchestration?forum=biztalkgeneral
I appreciate any form of help.
Kind regards
A.H.