Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Extracting SOAPFault Code and Reason in orchestration
- This topic has 1 reply, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
January 10, 2014 at 6:29 AM #26241
Hi
I’m having trouble extracting SOAPFault Code and Reson values (string).
Steps:
- 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’%5D/*%5Blocal-name()=’Code’ and namespace-uri()=’http://www.w3.org/2003/05/soap-envelope’%5D/*%5Blocal-name()=’Value’ and namespace-uri()=’http://www.w3.org/2003/05/soap-envelope’%5D/text()”);
strSoapFaultReason = xpath(msgSoapFault, “/*[local-name()=’Fault’ and namespace-uri()=’http://www.w3.org/2003/05/soap-envelope’%5D/*%5Blocal-name()=’Reason’ and namespace-uri()=’http://www.w3.org/2003/05/soap-envelope’%5D/*%5Blocal-name()=’Text’ and namespace-uri()=’http://www.w3.org/2003/05/soap-envelope’%5D/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 1:
<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 appreciate any form of help.
Kind regards
A.H.
- I’m using a Scope and Catch-shape to catch BTS.soap_envelope_1__2.Fault (variable sf)
-
January 13, 2014 at 6:58 AM #26244
I got help on MSDN BizTalk forum. The xpath must convert result to a string by using strng-function. E.g. xpath(msgSoapFault, "string(xpath)")
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.