Fix error logging in client-side validation
Closes gh-1144
This commit is contained in:
@@ -185,7 +185,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
|
||||
errors = this.validator.validate(requestSource);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new WebServiceIOException("Could not validate response: " + ex.getMessage(), ex);
|
||||
throw new WebServiceIOException("Could not validate request: " + ex.getMessage(), ex);
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(errors)) {
|
||||
return handleRequestValidationErrors(messageContext, errors);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class WebServiceValidationException extends WebServiceClientException {
|
||||
}
|
||||
|
||||
private static String createMessage(SAXParseException[] validationErrors) {
|
||||
StringBuilder builder = new StringBuilder("XML validation error on response: ");
|
||||
StringBuilder builder = new StringBuilder("XML validation error on request: ");
|
||||
|
||||
for (SAXParseException validationError : validationErrors) {
|
||||
builder.append(validationError.getMessage());
|
||||
@@ -49,7 +49,9 @@ public class WebServiceValidationException extends WebServiceClientException {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/** Returns the validation errors. */
|
||||
/**
|
||||
* Return the validation errors.
|
||||
*/
|
||||
public SAXParseException[] getValidationErrors() {
|
||||
return this.validationErrors;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class PayloadValidatingInterceptorTest {
|
||||
|
||||
assertThatExceptionOfType(WebServiceClientException.class)
|
||||
.isThrownBy(() -> this.interceptor.handleRequest(this.context))
|
||||
.withMessageContaining("XML validation error on response");
|
||||
.withMessageContaining("XML validation error on request");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -105,7 +105,7 @@ public class PayloadValidatingInterceptorTest {
|
||||
|
||||
assertThatExceptionOfType(WebServiceClientException.class)
|
||||
.isThrownBy(() -> this.interceptor.handleRequest(this.context))
|
||||
.withMessageContaining("XML validation error on response");
|
||||
.withMessageContaining("XML validation error on request");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -199,7 +199,7 @@ public class PayloadValidatingInterceptorTest {
|
||||
|
||||
assertThatExceptionOfType(WebServiceClientException.class)
|
||||
.isThrownBy(() -> this.interceptor.handleRequest(this.context))
|
||||
.withMessageContaining("XML validation error on response");
|
||||
.withMessageContaining("XML validation error on request");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user