Title: Bug of Feature? Exception hierarchies in java2wsdl

Hi,

I found the following bug (or feature?) when a WSDL is created out of Java class.

Scenario:
- There exist two Exceptions A and B. A extends java.lang.Exception and B extends A.
- A class MyClass has a method myMethod() that throws A and B.

Outcome:
- The WSDL contains only Exception A and not B, i.e. there doesn't exists a B message and the operation doesn't contain the fault B.

Bug Fix Suggestion:

Modify the method ServiceDesc.createFaultMetadata(...) from:

   FaultDesc fault = operation.getFaultByClass(ex);
   // If we didn't find one, create a new one
   if (fault == null) {
       fault = new FaultDesc();
   }

to:

   FaultDesc fault = operation.getFaultByClass(ex);
   // If we didn't find one, create a new one
   if (fault == null || !ex.getName().equals(fault.getClassName())) {
       fault = new FaultDesc();
   }

Reason:
The method 'operation.getFaultByClass(ex)' returns the superclass of an exception if the superclass is already known.


Should I report a Bug for this, or is it a feature?

Best regards,
Joern

Reply via email to