[SWS-824] In v 2.1.0, dispatch method of MessageDispatcher does not call processEndpointException method if response schema validation fails Created: 05/Feb/13  Updated: 15/Apr/13  Resolved: 15/Apr/13

Status: Resolved
Project: Spring Web Services
Component/s: Core
Affects Version/s: 2.1.2
Fix Version/s: 2.1.3

Type: Bug Priority: Major
Reporter: Subhajit Raha Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Windows, Java 7

Issue Links:
relates to SWS-754 EndpointInterceptor.afterCompletion i... Closed
Reference URL: http://forum.springsource.org/showthread.php?134305-FaultResolver-not-get-called-if-Response-schema-validation-fails-in-spring-ws-2-1-0


I have upgraded spring web service library from 2.0 to 2.1 in my application. But after that overriden customizeFault method of ServiceFaultExceptionResolver class (which extends SimpleSoapExceptionResolver of Spring) does not get invoked from dispatch method of MessageDispatcherServllet class if exception is thrown from overriden handleResponseValidationErrors method of PayloadValidatingInterceptorWithException class (Which extends PayloadValidatingInterceptor of Spring).

Now this works fine if I use v 2.0. But in v2.1, If exception is thrown from overriden handleResponseValidationErrors then control is coming to the second catch block of dispatch method which does not call processEndpointException. And processEndpointException is responsible to call all the fault resolver. second catch block is below:

catch (Exception ex) {
			// Trigger after-completion for thrown exception.
            triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, ex);
            throw ex;

If exception is thrown from overriden handleRequestValidationErrors method of PayloadValidatingInterceptorWithException ( which extends PayloadValidatingInterceptor of Spring) then control comes to the first catch block(Please see below) of dispatch method and that calls processEndpointException - So everything is fine for request schema validation fail scenario

catch (Exception ex) {
                Object endpoint = mappedEndpoint != null ? mappedEndpoint.getEndpoint() : null;
                processEndpointException(messageContext, endpoint, ex);

But In v 2.0 there is only one catch block in dispatch method for all the code and that catch block calls processEndpointException - So both request and response schema validation scenario works fine with v2.0.

So change of exception handling in dispatch method of v2.1 is breaking my application.

Generated at Sat Dec 15 05:06:06 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.