camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shyenuganti <shyenuga...@gmail.com>
Subject Re: Issue with Handling SoapFault
Date Fri, 12 Apr 2013 03:22:51 GMT
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.

Mime
View raw message