axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Kapoor <skap...@borland.com>
Subject Custom Exceptions
Date Tue, 11 Jun 2002 23:52:44 GMT
Hi:

what I want to do is write a custom exception class and propagate it 
from one of the methods on my Web-Service to the client.  So I define 
a Java exception class:
public class EInvalidCustomer extends Exception {
  public EInvalidCustomer(String err){
   super(err);
  }

The method on my web-service throws this EInvalidCustomer exception.
Now I run the WSDL2Java and I get
public class EInvalidCustomer extends org.apache.axis.AxisFault

Also in my WSDL I have a
<wsdl:fault message="intf:EInvalidCustomer" name="EInvalidCustomer"/>

So in my client when I call the method I catch 2 exceptions, 1 is the 
RemoteException and the other is EInvalidCustomer excpetion.  
However,  the catch is always going to the RemoteException.  Now if I 
replace EInvalidCustomer with AxisFault then the catch will go to the 
AxisFault.

I cannot find any example on Axis doc's that show how to pass a custom 
exception class.

Do you have any ideas????

Thanks,

-Sam



Mime
View raw message