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.

Thanks,

Petr


--- On Sat, 2/21/09, Daniel Kulp <[email protected]> wrote:
From: Daniel Kulp <[email protected]>
Subject: Re: How to consolidate various generated exception classes into same 
exception class?
To: [email protected]
Cc: "Petr V." <[email protected]>
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
[email protected]
http://www.dankulp.com/blog



      

Reply via email to