cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: How to consolidate various generated exception classes into same exception class?
Date Sat, 21 Feb 2009 03:39:01 GMT
On Fri February 20 2009 5:36:58 pm Petr V. wrote:
> Thanks Daniel for reply.
>
> Axis 1.4 can handle it properly that wsdl and generate only one exception.
> May be you people can support that in next version how axis 1.4 can handle
> the same wsdl to generate only one set of exception classes but CXF
> generates different version for each operation.

Depends on your definition of "properly".   CXF implements the JAX-WS spec and 
the JAX-WS spec dictates it this way.  Thus, from a spec compliance 
standpoint, CXF is handling it properly.   Is that ideal for your wsdl?  
Obviously not, but it is according to spec.

Dan


>
> Thanks,
>
> Petr
>
>
> --- On Sat, 2/21/09, Daniel Kulp <dkulp@apache.org> wrote:
> From: Daniel Kulp <dkulp@apache.org>
> Subject: Re: How to consolidate various generated exception classes into
> same exception class? To: users@cxf.apache.org
> Cc: "Petr V." <greatman787@yahoo.com>
> Date: Saturday, February 21, 2009, 1:31 AM
>
>
> Honestly, I'm going to doubt you can do anything about this.
>
> Using the jaxws customizations, you MAY be able to write a binding file
> that maps the exception classnames into common exception classes.   I'm not
> really
> sure.   It may complain about name conflicts if you do so though.
>
> Dan
>
> On Thu February 19 2009 5:27:55 pm Petr V. wrote:
> > We published some service last year using C# and WCF.
> >
> > Now we are porting code into java and we need to keep wsdl compatibility.
> >
> > Some one gave me wsdl generated from C# code.
> >
> > It looked real ugly. Each method was throwing its own version of same
> > exception.
> >
> > I used CXF wsdl2Java to general my code and I see 10s of exception
> > representing same exceptiong.
> >
> > For e.g Look at function definition generated via CXF wsdl2java
> >
> >  public ComputerInfo getComputers(
> >
> >   @WebParam(name = "groupId", targetNamespace =
> > "XXX")Integer groupId,
> >   @WebParam(name = "onlyActiveComputers", targetNamespace =
> > "XXX") Boolean onlyActiveComputers,
> >   @WebParam(name = "minComputerId", targetNamespace =
> > "XXX")Integer minComputerId,
> >   @WebParam(name = "maxResults", targetNamespace =
> > "XXX")Integer maxResults
> >     )
> > throws GetComputersObjectNotFoundFaultFaultFaultMessage,
> >            GetComputersInvalidDataFaultFaultFaultMessage,
> >           GetComputersGeneralFaultFaultFaultMessage,
> >           GetComputersDataAccessFaultFaultFaultMessage;
> >
> > I should have only four exception classes (ObjectNotFoundFault,
> > InvalidDataFault, GeneralFault, DataAccessFault)  but there are 100
> > opeartions in wsdl and each of them throw those same 4 exceptions but
> > generated code has 100 * 4 = 400 exception classes :-(. Each exception
> > has prefixed method name + exception name + FaultFaultMessage"
> >
> > We should have never publised such ugly wsdl but now nothing can't be
>
> done.
>
> > Is there any to consoliodate those 400 exceptions into 4 same exception
> > classes when I am generating code via CXF wsdl2java.
> >
> > Any help would be really appreciated.
> >
> > Thanks,

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message