You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org> on 2005/07/27 22:17:25 UTC
[jira] Resolved: (AXIS-987) Exception hierarchies get lost using java2wsdl
[ http://issues.apache.org/jira/browse/AXIS-987?page=all ]
Davanum Srinivas resolved AXIS-987:
-----------------------------------
Resolution: Cannot Reproduce
Assign To: (was: Axis Developers Mailing List)
Is this still a problem, please reopen the bug if you still see the problem in Axis 1.2.1 or latest CVS.
thanks,
dims
> Exception hierarchies get lost using java2wsdl
> ----------------------------------------------
>
> Key: AXIS-987
> URL: http://issues.apache.org/jira/browse/AXIS-987
> Project: Apache Axis
> Type: Bug
> Components: WSDL processing
> Versions: 1.1
> Environment: Operating System: All
> Platform: All
> Reporter: Joern Gebhardt
>
> When a WSDL is created out of a Java class the exception hierarchies get lost.
> 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:
> public void myMethod() throws A, 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.
> SIDE EFFECT OF THIS FIX:
> The auto-generated JUnit test classes when using wsdl2java might not compile
> any longer, because it might happen that exception A is caught before B and
> therefore the 'catch (B e2)' block is unreachable:
> try {
> ws.myMethod();
> catch (A e1) {
> ...
> } catch (B e2) {
> ...
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira