On Sun, Mar 7, 2010 at 8:05 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:
> Hi
>
> You can enable the soapFault=true on the CamelContext which turns
> faults into exceptions.
>
> Or you can simply add a processor step at the end of your route, and
> check if the exchange is a fault
>
> public void process(Exchange exchange) {
> boolean isFault = exchange.hasOut() && exchange.getOut().isFault();
> // do something before the OUT message is returned to the caller
> }
>

Ah the IN OUT is playing tricks on me, you most likely have to do

 public void process(Exchange exchange) {
 boolean isFault = exchange.getIn().isFault();
 // do something before the message is returned to the caller



>
> On Sat, Mar 6, 2010 at 4:51 PM, Jim Talbut <jtal...@spudsoft.co.uk> wrote:
>> Hi,
>>
>> I have a route that looks like this:
>>                from( sourceEndpoint )
>>                        .onException( java.lang.Throwable.class ).process(
>> new Processor() {
>>                                public void process(Exchange exchange) throws
>> Exception
>>                                {
>>                                    log.warn( "onException\n\n\n\n" );
>>                                    Throwable caused =
>> exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
>>                                    log.info( "caused = " +
>> caused.getClass().getCanonicalName() );
>>                                    log.info( "caused = " +
>> caused.getMessage() );
>>                                    log.info( "caused = " + caused.toString()
>> );
>>                                    log.info( "caused = " + caused );
>>                                }
>>                            }).end()
>>                        .to( destinationEndpoint );
>>
>> Both sourceEndpoint and destinationEndpoint are CXF endpoints.
>> When destinationEndpoint is unavailable (the server is down) the onException
>> handler is thrown correctly.
>>
>> But if destinationEndpoint returns a SOAP:Fault onException isn't triggered
>> and I can't find out how to modify the SOAP:Fault that the clients of
>> sourceEndpoint receive.
>> I need to ensure that SOAP:Server faults are modified before being returned
>> to the client.
>>
>> I tried adding a processor, but that only gets called on the way In, whether
>> it returns a fault or not.
>>
>> I'm new to camel but I've managed to get most of my requirements met,
>> leaving me with just this problem that's got me completely stumped.
>>
>> Thanks
>>
>> Jim
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to