One of another team told me they are consuming same wsdl but using Axis 1.4 for wsdl2java and they see only one exception classes generated instead of CXF generating 100 exception classes for me(one for each method with different name).
Thanks, Petr --- On Fri, 2/20/09, Petr V. <[email protected]> wrote: From: Petr V. <[email protected]> Subject: How to consolidate various generated exception classes into same exception class? To: [email protected] Date: Friday, February 20, 2009, 3:27 AM 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,
