spring-ws icon indicating copy to clipboard operation
spring-ws copied to clipboard

Wrong error message on request validation. [SWS-1078]

Open gregturn opened this issue 6 years ago • 0 comments

Maxim Butov opened SWS-1078 and commented

When using StrictPayloadValidatingInterceptor with validateRequest = true and request has errors, we get an incorrect error message:

org.springframework.ws.client.support.interceptor.WebServiceValidationException: XML validation error on response: cvc-complex-type.2.4.a: Invalid content was found starting with element 'channel'. One of '{username, customerCategory}' is expected. at org.springframework.ws.client.support.interceptor.AbstractValidatingInterceptor.handleRequestValidationErrors(AbstractValidatingInterceptor.java:203) at org.springframework.ws.client.support.interceptor.AbstractValidatingInterceptor.handleRequest(AbstractValidatingInterceptor.java:179) at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:597)

which refers to response, while the error is in the request.

The "response" is hardcoded in AbstractValidatingInterceptor#handleRequest as well as WebServiceValidationException#createMessage.


Affects: 3.0.7

gregturn avatar Nov 14 '19 12:11 gregturn