This rule flags references to the use of the
<exception-mapping>
element within JAX-RPC mapping files.
JAX-RPC has a single Exception data type that contains a one method constructor, where as JAX-WS uses a two
method Exception constructor, with the JAXB data type as the second parameter in the new constructor.
Taking one of the examples from Web
services migration scenarios: JAX-RPC to JAX-WS and JAXB; For the
ckAvailability
method, the JAX-RPC code generated the following
simple.InvalidDateFault
error.
Whereas JAX-WS code generates the following error
InvalidDateFault_Exception
error.
Another difference between JAX-RPC and JAX-WS are the constructors for these exceptions.
An example of JAX-RPC code that would produce an error might be displayed as
throw new InvalidDateFault("this is an InvalidDateFault");
.
For JAX-WS, this would be
throw new InvalidDateFault_Exception( "this is an InvalidDateFault_Exception", new
InvalidDateFault());
.
For more information, see Web
services migration scenarios: JAX-RPC to JAX-WS and JAXB