1 Reply Latest reply on Jan 12, 2009 8:55 AM by Alessio Soldano

    JAX-WS Conformance Requirements

    Darran Lofthouse Master

      I just quickly wanted to double check the interpretation a conformance requirement from the JAX-WS specification.

      From section 4.2.4 of the JAX-WS specification describing exception handling: -


      Conformance (Exceptions During Handler Processing): Exceptions thrown during handler processing on the client MUST be passed on to the application. If the exception in question is a subclass of WebService-Exception then an implementation MUST rethrow it as-is, without any additional wrapping, otherwise it MUST throw a WebServiceExceptionwhose cause is set to the exception that was thrown during handler processing.


      I read this as only being applicable on the client side and not on the server side of the call. However the HandlerChainExecutor is enforcing this on both sides, see the processHandlerFailure method: -

      http://anonsvn.jboss.org/repos/jbossws/stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java

      The problem is that the WSSecurityDispatcher throws a CommonSOAPFaultException so that a faultCode and faultString can be specified but as this class does not extend WebServiceException the HandlerChainExecutor is replacing the exception so loosing the faultCode and changing the faultString.

      The HandlerChainExecutor is instantiated from three locations, two for clients and one for server side, my proposal is to pass an additional parameter into the constructor to indicate if this is server side or client side and only enforce the conformance requirement if client side.

      I have considered other options such as changing class hierarchies for the exceptions but these changes potentially start to leak JAX-WS details into JAX-RPC specific code.