Hi Eric,

The Message.isFault() method is provided for backwards compatibility. Fault
messages are not used anymore in 2.x AFAIK. Instead, Exceptions are set on
the Exchange to signal errors.

Therefore, you should check Exchange.getException() != null. From what I
recall, the CXF producer sets any SOAP Fault as an Exception in the
Exchange - unless I'm mistaken...

Also, do you have any error handlers, onException blocks or doTry/doCatch
blocks? When an exception arises during routing, the route execution is
halted at the point where it failed and the error handlers are invoked.
That is to say that your processor would likely not be executed on a route
like this:

from("...")
   .to("cxf:bean:producer")   <<< sets a SOAP FAULT as an Exception
   .process(...);


Instead, the route would stop executing and the exception would be returned
immediately to the caller if you aren't doing error handling.

Check out the following for further info:
http://camel.apache.org/error-handler.html,
http://camel.apache.org/exception-clause.html,
http://camel.apache.org/try-catch-finally.html.

Regards,
Raúl.

On 4 April 2012 19:36, Castyn <eric.ben...@gmail.com> wrote:

> I currently have a custom processor setup within a route that does the
> following
>
>
> public class SoapFaultDetectionProcessor implements Processor {
>
>        public void process(Exchange exchange) throws Exception {
>                if(exchange.getIn().isFault()) {
>                        SoapFault fault =
> exchange.getIn().getBody(SoapFault.class);
>                System.out.println(fault.getMessage());
>                }
>        }
> }
>
> This processor immediately follows a CXF Producer in POJO mode.  I am
> having
> the service generate a soap fault, but for some reason the isFault() call
> always remains false.
>
> 1) Am I not using this properly or
> 2) Is there a better way to capture and manipulate / display SOAP faults
> (for logging purposes and such)
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Detecting-SOAP-Faults-tp5618665p5618665.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to