You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Miroslav Beranič <mi...@mibesis.si> on 2019/01/03 08:01:01 UTC

Camel 2.23.0-SNAPSHOT JMS Fault is not propagated to the CXF

Hi all,

I am working with 2.23.0-SNAPSHOT, where I have SOAP webservice using CXF.
I route message to JMS where I set Exception, like this in a dedicated
Processor instance:

@Override
    public void process(final Exchange exchange) throws Exception {
        final Message message = exchange.getOut();
        message.setBody(new IllegalStateException("Demo Exception."));
        message.setFault(true);
    }

The Fault is not passed back to the CXF, as I see that the "fault" flag is
set to false ( Exception is null ). And CXF thinks it received wrong
Response body for the initial SOAP request. And returns :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Part {
http://example.com/SoapWebserviceEndpoint}parameters should be of type
com.example.model.soapwebservice.GetVersionResponse, not
java.lang.IllegalStateException</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

At first I thought I was doing something wrong with the Camel routing, but
after debugging sessions I've seen that the Exception is not passed back
from JMS to CXF as Fault, but as a regular valid Response object.

I am about to check this with 2.24.0-SNAPSTHOT ( from camel-2.x branch ).
Can anyone help me on this, I can provide more info, if/when needed.

I've seen that the message leaving ActiveMQ onMessage method had
Exception/Fault set "as expected" but then I lost track and somewhere in
the middle it got lost as next in CXF/Camel routing I see the body is not
handled as Exception/Fault any more.

Running on a Karaf 4.2.2-SNAPSTHOT and CXF 3.2.7. ActiveMQ 5.16.0-SNAPSHOT.

Kind Regards,
Miroslav

Happy New Year to you all.

-- 
Miroslav Beranič
MIBESIS
+386(0)40/814-843
miroslav.beranic@mibesis.si
http://www.mibesis.si