users@jax-rpc.java.net

Exceptions

From: Peter Beelen <Peter.Beelen_at_PHILIPS.COM>
Date: Mon, 18 Mar 2002 06:34:35 -0700

Hello,

We are looking to the JAX-RPC spec as a way of having a formalized mapping of Java to SOAP. We have however some quistion with regard to Exceptions.

The JAX-RPC spec describes the mapping of soap faults to java exceptions. It states that service specific exceptions map to a class extended from java.lang.Exception. It also states that the message part is passed to the constructor as a single argument, and that there is a getter/setter pair for the same data.

This however seems to make it impossible to send arbitrary exceptions including some inheritance (between these exceptions) over the wire. It also seems not possible to have exceptions with multiple attributes. The question is why the type of the single message part of a fault was not used as basis for the execption type (as is done for parts in input and output messages). This would increase the possibilites a lot. It is still possible to specify that, when the message part is a elementary type, a wrapper exception is generated.

To obtain the result we want, we now need to create the inheritance tree in some JAX-RPC data type, and base a single exception on this type. This is not what you normally expect in a java interface. For me, this does not make the call really transparent. I now cannot catch specific exceptions anymore. I need to catch a single exception, and then switch on the actual type of a attribute of that exception.

Please could somebody comment on this. Am I completely wrong? Did I overlook some obvious documentation?

regards,

Peter Beelen