users@jax-rpc.java.net

Re: java.rmi.RemoteException vs. javax.xml.rpc.soap.SOAPFaultException

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Mon, 12 Sep 2005 20:43:06 -0700

Merten,
RemoteExceptions were used mainly to mark methods as web methods. If
you want to
throw service specific exceptions, delare those additional exceptions as
well in your method
signature. Note that there are restrictions as to what such an exception
can look like.

I suspect that what you get on the client is due to different
implementations interpretting
the spec differently. Your best bet is to NOT throw RemoteExceptions if
an error happens
in your service, but rather service specif exceptions.



Merten Schumann wrote:

>Hello,
>
>when on my JAX-RPC web service server side an IllegalArgumentException
>(which is a RuntimeException) gets thrown, in different combinations of
>server (Sun AS, Tomcat with Axis, WebSphere) and clients (Sun JAX-RPC or
>Axis JAX-RPC) the exception seems to be rethrown by the client side
>differently. I saw the IllegalArgumentException wrapped in a
>RemoteException as well as in a SOAPFaultException.
>
>My web service interface declares to throw RemoteException as required
>by the spec. And so I do wrap custom exceptions in a RemoteException.
>BTW: still I never saw the custom exception really wrapped in the
>RemoteException at the client side, getCause() always returns null
>there. :-(
>
>My question is, what about RuntimeExceptions? In the J2EE/JAX-RPC spec,
>is it well defined how RuntimeExceptions should be transferred and what
>the client SOAP stack should rethrow?
>
>Thanx a lot
> Merten
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
>For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>
>

-- 
 - Doug