Bug 1080697 - Null details in SOAP fault returned to Camel Route
Summary: Null details in SOAP fault returned to Camel Route
Keywords:
Status: ON_QA
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0 GA
Hardware: x86_64
OS: Linux
high
high
Target Milestone: CR1
: One-off release
Assignee: Aileen
QA Contact: Matej Melko
URL:
Whiteboard:
Depends On:
Blocks: 1146233 1146241
TreeView+ depends on / blocked
 
Reported: 2014-03-26 01:11 UTC by Wayne Toh
Modified: 2018-12-05 17:52 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1146233 1146241 (view as bug list)
Environment:
Last Closed:
Type: Bug


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


Links
System ID Priority Status Summary Last Updated
Red Hat Issue Tracker SWITCHYARD-2038 Major Resolved Unable to retrieve Fault Detail from SOAPFault messages 2017-03-27 18:44:52 UTC
Red Hat Issue Tracker SWITCHYARD-2139 Major Open Null details in SOAP fault returned to Camel Route 2017-03-27 18:44:52 UTC

Description Wayne Toh 2014-03-26 01:11:45 UTC
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 13:38:25 UTC
Created attachment 879487 [details]
External WS by Wayne

Comment 2 Magesh Kumar Bojan 2014-03-27 13:39:02 UTC
Created attachment 879488 [details]
Proxy by Wayne

Comment 3 Magesh Kumar Bojan 2014-03-27 13:47:00 UTC
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-28 02:05:14 UTC
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 13:12:31 UTC
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 13:16:15 UTC
Created attachment 879827 [details]
server log by Magesh

Comment 7 Wayne Toh 2014-03-31 01:19:20 UTC
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 06:55:22 UTC
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 05:45:53 UTC
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 05:46:56 UTC
Created attachment 882522 [details]
additional patch

Comment 11 Magesh Kumar Bojan 2014-04-04 05:47:49 UTC
Created attachment 882523 [details]
modified bean

Comment 12 Wayne Toh 2014-04-07 05:37:12 UTC
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.