Extracting SOAPFault Code and Reason in an orchestration

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:

  1. Send port is configured with Propagate Fault Message = true
  2. I'm using a Scope and Catch-shape to catch BTS.soap_envelope_1__2.Fault (variable sf)
  3. 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.
  4. 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.

January 12th, 2014 4:30pm

Have you checked on the variable scopes.

Free Windows Admin Tool Kit Click here and download it now
January 12th, 2014 7:52pm

Nope. IMHO your XPATH sytax is NOT Correct. For the XPATH to work correctly in the orchestration you should use

stringVar = xpath(message, "string(<the XPATH>)");

The /*[local-name()=' ' and namespace-uri()=' '/text() still returns a XML Node of type #text and not the value.

Regards.

January 13th, 2014 12:12am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics