Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1080697 - Null details in SOAP fault returned to Camel Route
Null details in SOAP fault returned to Camel Route
Status: ON_QA
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard (Show other bugs)
6.0.0 GA
x86_64 Linux
high Severity high
: CR1
: One-off release
Assigned To: Aileen
Matej Melko
:
Depends On:
Blocks: 1146233 1146241
  Show dependency treegraph
 
Reported: 2014-03-25 21:11 EDT by Wayne Toh
Modified: 2016-01-19 10:20 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1146233 1146241 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
External WS by Wayne (11.96 KB, application/x-zip-compressed)
2014-03-27 09:38 EDT, Magesh Kumar Bojan
no flags Details
Proxy by Wayne (63.42 KB, application/x-zip-compressed)
2014-03-27 09:39 EDT, Magesh Kumar Bojan
no flags Details
Patch to test (25.38 KB, application/zip)
2014-03-27 09:47 EDT, Magesh Kumar Bojan
no flags Details
server log by Magesh (218.96 KB, text/plain)
2014-03-28 09:16 EDT, Magesh Kumar Bojan
no flags Details
additional patch (127.71 KB, application/zip)
2014-04-04 01:46 EDT, Magesh Kumar Bojan
no flags Details
modified bean (1.41 KB, text/plain)
2014-04-04 01:47 EDT, Magesh Kumar Bojan
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker SWITCHYARD-2038 Major Resolved Unable to retrieve Fault Detail from SOAPFault messages 2017-03-27 14:44 EDT
JBoss Issue Tracker SWITCHYARD-2139 Major Open Null details in SOAP fault returned to Camel Route 2017-03-27 14:44 EDT

  None (edit)
Description Wayne Toh 2014-03-25 21:11:45 EDT
Description of problem:

I am currently having a SOAP consumer that has a CAMEL implementation that calls a web service. The returned response from the backend is a SOAP fault. I wish to get the fault details and return a custom/modelled SOAP response back to the caller via a messagecomposer. However, in the CAMEL exchange, the fault details are null. 
 
Version-Release number of selected component (if applicable):

switchyard runtime version is 1.1.1-p5

How reproducible:

Always

Steps to Reproduce:
1. Create a web service provider that returns a SOAP fault detail
2. Create a web service consumer that implements a Camel route and calls the backend web service via SOAP binding
3. Invoke the web service consumer

Actual results:

In Camel, exchange.EXCEPTION_CAUGHT exception message has the details as null

Expected results:

The SOAP fault details should be present in the exchange.EXCEPTION_CAUGHT exception message

Additional info:

The SOAPMessageComposer.java is returning a detailNode

try {
            if (soapBody.hasFault()) {
                // peel off the Fault element
                SOAPFault fault = soapBody.getFault();
                if (fault.hasDetail()) {
                    Detail detail = fault.getDetail();
                    // We only support one entry at this moment
                    DetailEntry entry = null;
                    Iterator<DetailEntry> entries = detail.getDetailEntries();
                    if (entries.hasNext()) {
                        entry = entries.next();
                    }
                    if (entry != null) {
                        Node detailNode = entry.getParentNode().removeChild(entry);
                        message.setContent(detailNode);
                        return message;
                    }
                }
            }
Comment 1 Magesh Kumar Bojan 2014-03-27 09:38:25 EDT
Created attachment 879487 [details]
External WS by Wayne
Comment 2 Magesh Kumar Bojan 2014-03-27 09:39:02 EDT
Created attachment 879488 [details]
Proxy by Wayne
Comment 3 Magesh Kumar Bojan 2014-03-27 09:47:00 EDT
Created attachment 879502 [details]
Patch to test

Hi Wayne,

I am attaching a patch that needs to be copied onto modules/system/layers/soa/org/switchyard/component/camel/switchyard/main

Please test this and let me know.
Comment 4 Wayne Toh 2014-03-27 22:05:14 EDT
Hi Magesh

I have tested it. The behaviour still remains the same. I am not seeing the details in the exception message.
Comment 5 Magesh Kumar Bojan 2014-03-28 09:12:31 EDT
Hi Wayne,

With handleFault set to false, in soapUI I get the following result:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
   <soap:Body>
      <SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
         <faultcode>SOAP-ENV:Fault</faultcode>
         <faultstring>SWITCHYARD035448: Send Failed</faultstring>
         <detail>
            <PO:order xmlns:PO="http://webservice_producer/goodbyeworld">
               <symbol xmlns="http://webservice_producer/goodbyeworld">SUNW</symbol>
            </PO:order>
         </detail>
      </SOAP-ENV:Fault>
   </soap:Body>
</soap:Envelope>

and with handleFault set to true, I see this in the log:

[stdout] (http-/127.0.0.1:8080-25) =====in exception handling Service======
[stdout] (http-/127.0.0.1:8080-25) ======== The exception is =======CamelExceptionCaught
[stdout] (http-/127.0.0.1:8080-25) ======== switchyard exchange msg is =======[PO:order: null]

Could you be more specific as to what is null? Please not I tested the sayGoodbye method. I will attach my log for both the test run
Comment 6 Magesh Kumar Bojan 2014-03-28 09:16:15 EDT
Created attachment 879827 [details]
server log by Magesh
Comment 7 Wayne Toh 2014-03-30 21:19:20 EDT
Hi Magesh

When handleFault is set to true, as you have tested, the exception message becomes
[PO:order: null]

The whole fault details should be seen as below in the camel exception. As without the details the fault handler will not be able to model and return a custom fault back to the consumer. 
<PO:order xmlns:PO="http://webservice_producer/goodbyeworld">
               <symbol xmlns="http://webservice_producer/goodbyeworld">SUNW</symbol>
            </PO:order>
Comment 8 Magesh Kumar Bojan 2014-03-31 02:55:22 EDT
Wayne,

The exception message is a org.w3c.dom.Node. If you properly print the node in the bean, then the entire detail will be there.
Comment 9 Magesh Kumar Bojan 2014-04-04 01:45:53 EDT
Okay, I have attached another patch that goes along with the earlier one. This needs to be copied onto modules/system/layers/soa/org/switchyard/component/soap/main

I have changed the way to retrieve the fault details in hihiServiceBean. I have attached that too. Please note there is no need to use any custom composer.
Comment 10 Magesh Kumar Bojan 2014-04-04 01:46:56 EDT
Created attachment 882522 [details]
additional patch
Comment 11 Magesh Kumar Bojan 2014-04-04 01:47:49 EDT
Created attachment 882523 [details]
modified bean
Comment 12 Wayne Toh 2014-04-07 01:37:12 EDT
Hi Magesh, it is now working as expected.

Note You need to log in before you can comment on or make changes to this bug.