The bytecode has the differentiation between the two exceptions (if you decomile a method that throws A and B both exceptions are in the throws clause).
Of cause you can always catch A, but sometime you want to differentiate between these two exceptions. If B is not mentioned in the WSDL the WS client cannot generate exception B and therefore cannot catch it.
J�rn
-----Urspr�ngliche Nachricht-----
Von: Robert Lowe [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 4. August 2003 22:16
An: [EMAIL PROTECTED]
Betreff: Re: Exception hierarchies in WSDL
Well, if a method is declared to throw A, and B extends A, then the method can also throw B, regardless of whether B appears in the throws clause. So this:
public void myMethod() throws A, B;
is semantically equivalent to this:
public void myMethod() throws A;
So it's entirely possible that the compiler ignores B in throws clause, and generates bytecode equivalent to the first declaration. I'm not a compiler expert, so I don't know whether that actually happens, I'm just saying it's possible. In that case java2wsdl would have no way of knowing that the source code also included B in the throws clause.
- Rob
----- Original Message -----
From: J�rn Gebhardt
To: [EMAIL PROTECTED]
Sent: Monday, August 04, 2003 9:58 PM
Subject: Exception hierarchies in WSDL
Hi,
Niranjan already asked this question in May, but did't get any answer. Perhaps now somebody has an idea.
I have the following problem with exceptions when creating a
WSDL description out of a Java class using Axis java2wsdl:
I have two exceptions A and B. A extends java.lang.Exception and B
extends A (A is a base class for all my exceptions).
Now I have a method declaration like this:
public void myMethod() throws A, B;
When this method gets transformed into WSDL using Axis java2wsdl the
WSDL does not contain a message pertaining to exception B and the
operation tag in the binding only shows the fault for
exception A and nothing for B.
Does anyone know why this is happening? That is why Axis is only
picking up the base exception and not the derived one?
Thanks for any help,
Joern
