camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: Issue with Handling SoapFault
Date Fri, 12 Apr 2013 03:31:00 GMT
The first line onException will setup interceptors on all the camel endpoints, which means
it will wrap all the calling.
I'm not sure what .to(POLICY_WEBSERVICE_CALL) looks like.
I don't think you are using camel-cxf component to invoke the service, maybe you are using
ProduceTemplate to do that kind of work.
I think that is why the SoapFault is wrapped with in a CamelExecutionException.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Friday, April 12, 2013 at 11:22 AM, shyenuganti wrote:

> Hi William,
>  
> My understanding of the exception propagation in Camel is as follows :  
>  
> 1. Camel invokes the inroute exception first before propagating the
> exception to the global handler.  
>  
> In this case, If my route throws a soapFault, It should be handled firs on
> the route as it is explicitly handled. The first line should be invoked for
> any other exceptions thrown apart from "SoapFault".
>  
> How does the first line effect the onexception() in the route?
>  
> I have worked on the route a bit more after this post. I used a try() ...
> catch.
>  
> .doTry()  
> .to(POLICY_WEBSERVICE_CALL)
> .doCatch(SoapFault.class)
> .process(new Processor(){
>  
> @Override
> public void process(Exchange exchange) throws Exception {
> System.out.println("From Inroute SOAPFault Handler ... ");
> SoapFault faultex = exchange.getProperty(Exchange.EXCEPTION_CAUGHT,
> SoapFault.class);  
> logger.debug(faultex.getDetail().getTextContent());
> }
>  
> })
>  
> .doCatch(Exception.class)
> .process(new Processor(){
>  
> @Override
> public void process(Exchange exchange) throws Exception {
> System.out.println("From Inroute Exception Handler ...
> "+exchange.getProperty(Exchange.EXCEPTION_CAUGHT));
> //System.out.println("Exchange properties :
> "+exchange.getProperties().toString());
>  
>  
> }
>  
> })
>  
> .end()
>  
> This one actually catches the exception. But it is not exactly a saopFault.
> But that is wrapped in a camelExecutionException. And that is caught in the
> second catch block above.  
>  
> System.out.println("From Inroute Exception Handler ...
> "+exchange.getProperty(Exchange.EXCEPTION_CAUGHT));  
>  
> is giving me this camelExecutionException. How can I extract the soapFault
> from this?
>  
> Why is dotry() ...catch() catching the exception but onexception() is not
> working if I replace at the same place in the route?
>  
>  
> I am confused how Camel handles this exception processing. Please help.
>  
> Sri Harsha Yenuganti.
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Issue-with-Handling-SoapFault-tp5730718p5730740.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message