Skip to content

In v 2.1.0, dispatch method of MessageDispatcher does not call processEndpointException method if response schema validation fails [SWS-824] #792

@gregturn

Description

@gregturn

Subhajit Raha opened SWS-824 and commented

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.


Affects: 2.1.2

Reference URL: http://forum.springsource.org/showthread.php?134305-FaultResolver-not-get-called-if-Response-schema-validation-fails-in-spring-ws-2-1-0

Issue Links:

Referenced from: commits 3a09d29

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions