Paul Andrews wrote:
I've had a look back through the list archives and looked for some
example in the ditribution but I can't see anything that tells me how I
deploy a service that can throw exceptions and what I should expect to
see back in the client if one of those exceptions is thrown.

1. Do I need to specify serializers/deserializers for my exceptions?
2. How do the exceptions get returned from call.invoke() in the client?

Any help would be appreciated.




Hi,


I am starting work on extending a project someone else wrote, but he used exceptions extensively I can give you an example. It might help. Or it might not?

For example he tries to load some property file:

try {
   in = new BufferedInputStream(
          new FileInputStream("somefilename"));
          properties.load(in);
   } catch (Exception e) {
          properties.clear();
          throw new SOAPException("properties in could not be
                loaded",e);
   }

Calling a test program with ant (which calls the client which calls the service ... etc.), I get the following error message:

test:
  [java] Hello Tester
  [java] This is the end of the world!
  [java] javax.xml.soap.SOAPException: properties in could not be loaded

The most interesting thing is: the Exceptions error message occurs after the last line of code (System.out.println("This is the end of the world")) of my test class' main is executed.

Now I can add some more marks to your question: is this the correct way to use exceptions with axis services or should I use something else? And how do I get myself a stacktrace? I am guessing I won't, oh well.

Ciao
Sonja

--
[EMAIL PROTECTED], Tel: 91374-370

Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut. --Ernest Hemingway



Reply via email to