exception handling

From: Ian Jones <>
Date: Tue, 10 May 2005 15:16:27 +0100

I'm attempting to throw a service-specific exception in my JAX-RPC web
service. This exception is defined, simply, as follows:
public class InvalidPasswordException extends Exception {
    public InvalidPasswordException() {
and is thrown in the interface of my web service here:
String login(String password) throws RemoteException,
I then use wscompile to generate the WSDL, server ties and client stubs.
However the client stub generated for the exception is called
InvalidPasswordException_Exception and this is thrown by the login
method's client stub. Is this what should happen?
In my client I attempt to catch this InvalidPasswordException_Exception
exception as follows:
   try {
            fail("Password was not invalid");
         } catch (InvalidPasswordException_Exception e) {
         } catch (ServerException e) {
         } catch (Exception e) {
             fail("failed due to exception " + e.getMessage());
In this case the server correctly attempts to throw a new
InvalidPasswordException, but the client catches a ServerException which
mentions the InvalidPasswordException within it's message. Is this also
correct? Shouldn't I just be able to catch an InvalidPasswordException
as specified by the service's interface?
Many thanks for any help,
Ian Jones
Senior Analyst Developer
Piper Group plc
Tel: + 44 (0) 1454 284900
Fax: + 44 (0) 1454 284950 <>
Information contained in this e-mail is intended for the use of the
addressee only, and is confidential and may be the subject of legal
professional privilege. Any dissemination, distribution, copying or use
of this communication without permission of the addressee is strictly
prohibited. The views expressed in this communication may not
necessarily be the views held by Piper Group plc.