You can get the fault by using exchange.getException();

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On July 29, 2014 at 2:15:05 PM, Jaishankar ([email protected]) wrote:
> If the exchange has soap fault how to capture the message in it?
>  
> *I tried this way*
> Exchange exchangeNew = producerTemplate.send("cxf:bean:TransactionBegin",
> exchange);
>  
> SoapFault soapFaultException = exchangeNew
> .getOut().getBody(SoapFault.class);
>  
> *Error Message*
>  
> Failed delivery for (MessageId: I
> D-gdjb01vd-33915-1406546122662-166-3 on ExchangeId:
> ID-gdjb01vd-33915-1406546122662-166-2). Exhausted after delivery attempt: 1
> caught: org.apache.cxf.binding.soap.Soap
> Fault: "DISTRICT CODE NOT ON FILE "
> org.apache.cxf.binding.soap.SoapFault: "message ---- "
> at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)[158:org.apache.cxf.cxf-rt-bindings-soap:2.6
>   
> .0.redhat-60024]
>  
> I need to handle this fault in the exchange and get faultcode and
> faultstring.
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Handle-SOAP-fault-message-tp5754549.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  

Reply via email to