-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Ryan Breidenbach opened SWS-74 and commented
The soap fault details that are generated by the AbstractValidatingInterceptor (via the PayloadValidatingInterceptor) do not have the correct namespace. Here is an example of a soap fault I received:
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Validation error</faultstring>
<detail>
<spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-datatype-valid.1.2.1: '?' is not a valid value for 'dateTime'.</spring-ws:ValidationError>
<spring-ws:ValidationError>cvc-type.3.1.3: The value '?' of element 'sch:Date' is not valid.</spring-ws:ValidationError>
<spring-ws:ValidationError>cvc-datatype-valid.1.2.1: '?' is not a valid value for 'integer'.</spring-ws:ValidationError>
<spring-ws:ValidationError>cvc-type.3.1.3: The value '?' of element 'sch:NumberOfDays' is not valid.</spring-ws:ValidationError>
</detail>
</soapenv:Fault>
As you can see, the first ValidationError element has the namespace defined, where the next three do not, but still contain the namespace prefix. Instead, it should probably look like this:
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Validation error</faultstring>
<detail xmlns:spring-ws="http://springframework.org/spring-ws">
<spring-ws:ValidationError>cvc-datatype-valid.1.2.1: '?' is not a valid value for 'dateTime'.</spring-ws:ValidationError>
<spring-ws:ValidationError>cvc-type.3.1.3: The value '?' of element 'sch:Date' is not valid.</spring-ws:ValidationError>
<spring-ws:ValidationError>cvc-datatype-valid.1.2.1: '?' is not a valid value for 'integer'.</spring-ws:ValidationError>
<spring-ws:ValidationError>cvc-type.3.1.3: The value '?' of element 'sch:NumberOfDays' is not valid.</spring-ws:ValidationError>
</detail>
</soapenv:Fault>
It appears that the namespace definition is mistakenly being applied to the first ValidationError element when it should be applied to the parent detail element.
Also (and this may be a separate issue), any idea why there appears to be two validation errors for the same validation failure? It this example, there are really two errors, not four - sending invalid data for both the Date and NumberOfDays request elements, but we received two validation errors for each of these validation failures. Perhaps this should be logged as a separate issue?
Affects: 1.0 M2
Referenced from: commits 8fd81f3