Skip to content

Client-side validation logs an invalid request as the response being invalid [SWS-1078] #1144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gregturn opened this issue Nov 14, 2019 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@gregturn
Copy link
Contributor

gregturn commented Nov 14, 2019

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 gregturn added status: waiting-for-triage An issue we've not yet triaged in: core labels Sep 22, 2020
@snicoll snicoll removed the in: core label Feb 19, 2025
@snicoll snicoll self-assigned this Apr 2, 2025
@snicoll
Copy link
Member

snicoll commented Apr 2, 2025

PayloadValidatingInterceptorTest looks odd as the tests that seem to be for testing invalid request have invalid response in the expected error message.

@snicoll snicoll changed the title Wrong error message on request validation. [SWS-1078] Client-side validation logs an invalid request as the response being invalid [SWS-1078] Apr 16, 2025
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 16, 2025
@snicoll snicoll added this to the 4.0.13 milestone Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants