After some discussion with Charles, it turns out the fault message is not set 
up rightly, and we don't need to add the extra classes created to extend 
Exceptions into the JAXB context as CXFEndpoint does as the CXF fault out 
interceptor chain will take care of Fault message for us.

If you want to setup an customer fault message to the camel-cxf consumer, 
Please take a look at example here[1].

[1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfCustomizedExceptionTest.java
  

--  
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 Saturday, January 19, 2013 at 12:55 AM, Charles Moulliard wrote:

> Hi,
>  
> My camel cxf project uses SOAP fault and Exceptions classes. They are
> generated by cxf 2.6.4 (camel used = 2.10.3)
>  
> package com.redhat.fuse.example;
>  
> import javax.xml.ws.WebFault;
>  
> /**
> * This class was generated by Apache CXF 2.6.4
> * 2013-01-18T17:50:59.270+01:00
> * Generated source version: 2.6.4
> */
>  
> @WebFault(name = "NoSuchCustomer", targetNamespace = "
> http://example.fuse.redhat.com/";)
> public class NoSuchCustomerException extends Exception {
>  
> private com.redhat.fuse.example.NoSuchCustomer noSuchCustomer;
>  
> Nevertheless when the camel cxf endpoint gets the object
> (NoSuchCustomerException) to be transformed and next SOAP message created,
> the following JAXB error is populated
>  
> https://gist.github.com/6a64fffe39e63200e98a
>  
> I have tried to add that in endpoint configuration but this is not allowed
>  
> <cxf:cxfEndpoint id="WS"
> address="http://0.0.0.0:9191/training/WebService";
> serviceClass="com.redhat.fuse.example.CustomerService">
> <cxf:outInterceptors>
> <ref bean="loggingOutInterceptor"/>
> </cxf:outInterceptors>
> <cxf:inInterceptors>
> <ref bean="loggingInInterceptor"/>
> <ref bean="wss4jInInterceptor"/>
> <ref bean="authenticationInterceptor"/>
> </cxf:inInterceptors>
> <cxf:properties>
> <entry key="ws-security.validate.token" value="false"/>
> <!-- Add extra classes created to extend Exceptions -->
> <entry key="jaxb.additionalContextClasses">
> <bean
> class="org.apache.cxf.systest.jaxb.util.ClassArrayFactoryBean">
> <property name="classNames">
> <list>
>  
> <value>com.redhat.fuse.example.NotAuthorizedUserException</value>
>  
> <value>com.redhat.fuse.example.NoSuchCustomerException</value>
> </list>
> </property>
> </bean>
> </entry>
> </cxf:properties>
> </cxf:cxfEndpoint>
>  
> Is there a trick ?
>  
> Regards,
>  
> --  
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com



Reply via email to