Christian,

This is "per spec".   The schema controls the name of the actual JAXB bean 
that is created to hold the fault information.   Thus, if the schema 
says "NoSuchCustomerException", that is the bean name.   Since that name is 
then already taken, when we generate the exception that wrappers the bean, we 
have to append "_Exception" per spec.   

Since your example is a code first scenario, you can add something like:
@WebFault(name = "NoSuchCustomer") or similar which would result in the name 
used in the schema to be something different.

Per jaxws spec, all generated faults are checked exceptions.  We could 
possibly find a way to parameterize that, but by default, they have to be 
checked.   If you are interested, the velocity template is at:
http://svn.apache.org/repos/asf/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/fault.vm
and the processor that processes the faults:
http://svn.apache.org/repos/asf/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
(you can see the name collision stuff in there as well)

Dan


On Tuesday 19 August 2008 5:12:35 pm Christian Schneider wrote:
> Hi,
>
> I have a wsdl defining a fault. When I run the cxf-codegen plugin I get
> two classes in Java NoSuchCustomerException and
> NoSuchCustomerException_Exception.
> The first thing I don“t like is that the Exception is a checked
> Exception, no RuntimeException. Can I configure this somewhere?
> The other thing is the the real Exception has the name
> Exception_Exception .. this looks ugly.
>
> The wsdl was generated from Java code. In the Java code I used a Runtime
> Exception NoSuchCustomerException without any special settings.
>
> Best regards
>
> Christian



-- 
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to