Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-74

Namespace not being applied correctly to soap fault detail elements.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.0 M2
    • Fix Version/s: 1.0 M3
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows XP and AIX using AxiomSoapMessageFactory. spring-ws-M3-SNAPSHOT. Java 1.5

      Description

      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?

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              breidenr Ryan Breidenbach
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: