/** * Determine an error <code>SOAPMessage</code> response via the registered <code>EndpointExceptionResolvers</code>. * Most likely, the response contains a <code>SOAPFault</code>. If no suitable resolver was found, the exception is * rethrown. * * @param messageContext current SOAPMessage request * @param endpoint the executed endpoint, or null if none chosen at the time of the exception * @param ex the exception that got thrown during handler execution * @throws Exception if no suitable resolver is found */ protected void processEndpointException(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) { if (resolver.resolveException(messageContext, endpoint, ex)) { if (logger.isDebugEnabled()) { logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex); } return; } } // exception not resolved throw ex; }
/** * Determine an error {@code SOAPMessage} response via the registered {@code EndpointExceptionResolvers}. * Most likely, the response contains a {@code SOAPFault}. If no suitable resolver was found, the exception is * rethrown. * * @param messageContext current SOAPMessage request * @param endpoint the executed endpoint, or null if none chosen at the time of the exception * @param ex the exception that got thrown during handler execution * @throws Exception if no suitable resolver is found */ protected void processEndpointException(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { if (!CollectionUtils.isEmpty(getEndpointExceptionResolvers())) { for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) { if (resolver.resolveException(messageContext, endpoint, ex)) { if (logger.isDebugEnabled()) { logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex); } return; } } } // exception not resolved throw ex; }
/** * Determine an error {@code SOAPMessage} response via the registered {@code EndpointExceptionResolvers}. * Most likely, the response contains a {@code SOAPFault}. If no suitable resolver was found, the exception is * rethrown. * * @param messageContext current SOAPMessage request * @param endpoint the executed endpoint, or null if none chosen at the time of the exception * @param ex the exception that got thrown during handler execution * @throws Exception if no suitable resolver is found */ protected void processEndpointException(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { if (!CollectionUtils.isEmpty(getEndpointExceptionResolvers())) { for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) { if (resolver.resolveException(messageContext, endpoint, ex)) { if (logger.isDebugEnabled()) { logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex); } return; } } } // exception not resolved throw ex; }
/** * Determine an error {@code SOAPMessage} response via the registered {@code EndpointExceptionResolvers}. * Most likely, the response contains a {@code SOAPFault}. If no suitable resolver was found, the exception is * rethrown. * * @param messageContext current SOAPMessage request * @param endpoint the executed endpoint, or null if none chosen at the time of the exception * @param ex the exception that got thrown during handler execution * @throws Exception if no suitable resolver is found */ protected void processEndpointException(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { if (!CollectionUtils.isEmpty(getEndpointExceptionResolvers())) { for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) { if (resolver.resolveException(messageContext, endpoint, ex)) { if (logger.isDebugEnabled()) { logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex); } return; } } } // exception not resolved throw ex; }
/** * Handles an invalid SOAP message. Default implementation logs the given exception, delegates to the set {@link * #setExceptionResolver(EndpointExceptionResolver) exceptionResolver} if any, or creates a SOAP 1.1 Client or SOAP * 1.2 Sender Fault with the exception message as fault string, and returns {@code false}. * * @param ex the validation exception * @param messageContext the message context * @return {@code true} to continue processing the message, {@code false} (the default) otherwise */ protected boolean handleValidationException(WsSecurityValidationException ex, MessageContext messageContext) { if (logger.isWarnEnabled()) { logger.warn("Could not validate request: " + ex.getMessage()); } if (exceptionResolver != null) { exceptionResolver.resolveException(messageContext, null, ex); } else { if (logger.isDebugEnabled()) { logger.debug("No exception resolver present, creating basic soap fault"); } SoapBody response = ((SoapMessage) messageContext.getResponse()).getSoapBody(); response.addClientOrSenderFault(ex.getMessage(), Locale.ENGLISH); } return false; }
/** * Handles an invalid SOAP message. Default implementation logs the given exception, delegates to the set {@link * #setExceptionResolver(EndpointExceptionResolver) exceptionResolver} if any, or creates a SOAP 1.1 Client or SOAP * 1.2 Sender Fault with the exception message as fault string, and returns {@code false}. * * @param ex the validation exception * @param messageContext the message context * @return {@code true} to continue processing the message, {@code false} (the default) otherwise */ protected boolean handleValidationException(WsSecurityValidationException ex, MessageContext messageContext) { if (logger.isWarnEnabled()) { logger.warn("Could not validate request: " + ex.getMessage()); } if (exceptionResolver != null) { exceptionResolver.resolveException(messageContext, null, ex); } else { if (logger.isDebugEnabled()) { logger.debug("No exception resolver present, creating basic soap fault"); } SoapBody response = ((SoapMessage) messageContext.getResponse()).getSoapBody(); response.addClientOrSenderFault(ex.getMessage(), Locale.ENGLISH); } return false; }
/** * Handles an invalid SOAP message. Default implementation logs the given exception, delegates to the set {@link * #setExceptionResolver(EndpointExceptionResolver) exceptionResolver} if any, or creates a SOAP 1.1 Client or SOAP * 1.2 Sender Fault with the exception message as fault string, and returns {@code false}. * * @param ex the validation exception * @param messageContext the message context * @return {@code true} to continue processing the message, {@code false} (the default) otherwise */ protected boolean handleValidationException(WsSecurityValidationException ex, MessageContext messageContext) { if (logger.isWarnEnabled()) { logger.warn("Could not validate request: " + ex.getMessage()); } if (exceptionResolver != null) { exceptionResolver.resolveException(messageContext, null, ex); } else { if (logger.isDebugEnabled()) { logger.debug("No exception resolver present, creating basic soap fault"); } SoapBody response = ((SoapMessage) messageContext.getResponse()).getSoapBody(); response.addClientOrSenderFault(ex.getMessage(), Locale.ENGLISH); } return false; }