axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: Error reporting
Date Fri, 19 Jul 2002 18:32:15 GMT

----- Original Message -----
From: "Jesse D. Sightler" <>
To: <>
Sent: Friday, July 19, 2002 10:03 AM
Subject: Re: Error reporting

> The relevant section from the User Guide appears to be:
> [Begin Quote]
> Exceptions are represented as wsdl:fault elements
> If a method is marked as throwing an Exception, that is not an instance
> or a subclass of java.rmi.RemoteException, then things are subtly
> different. The exception is no longer a SOAP Fault, but described as a
> wsdl:fault in the WSDL of the method. According to the JAX-RPC
> specification, your subclass of Exception must have accessor methods to
> access all the fields in the object to be marshalled and a constructor
> that takes as parameters all the same fields (i.e arguments of the same
> name and type). This is a kind of immutable variant of a normal
> JavaBean. The fields in the object must be of the datatypes that can be
> reliably mapped into WSDL.
> If your exception meet this specification, then the WSDL describing the
> method will describe the exception too, enabling callers to create stub
> implementations of the exception , regardless of platform.
> Again, to be sure of interoperability, you need to be experiment a bit.
> Remember, the calling language may not have the notion of Exceptions, or
> at least not be as rigorous as Java in the rules as to how exceptions
> must be handled.
> [End Quote]

I wrote that bit by looking at the JAX-RPC spec, not the implementation, so
remember, it may not be true :)

> I am truly curious... has anyone experimented with this to see if it
> will allow Java AXIS clients to use normal try...catch blocks to catch
> customer Exception classes?

I am throwing simple Exceptions and it does seem to work. hook into a
RemoteException and you can catch transport events, normal exceptos for
things you throw yourself.

public void doSomething(string param) throws Exception {

1. I havent tried sending my own exceptions back
2. I havent run the wsdl through WSDL.exe to see what C# makes of it.

View raw message