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?

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        With regard to the duplicate validation errors: these are the direct result of the parse of the xml. In other words: the XML parser gives two validation errors per failure. I don't think there is something we can do about it, except create a fragile error string parsing algorithm.

        Show
        arjen.poutsma Arjen Poutsma added a comment - With regard to the duplicate validation errors: these are the direct result of the parse of the xml. In other words: the XML parser gives two validation errors per failure. I don't think there is something we can do about it, except create a fragile error string parsing algorithm.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I've create a testcase for this issue: PayloadValidatingInterceptorTest.testCreateRequestValidationFaultAxiom(), but I cannot reproduce it. Perhaps it has been fixed as part of Axiom 1.2, which is what we currently use.

        Show
        arjen.poutsma Arjen Poutsma added a comment - I've create a testcase for this issue: PayloadValidatingInterceptorTest.testCreateRequestValidationFaultAxiom(), but I cannot reproduce it. Perhaps it has been fixed as part of Axiom 1.2, which is what we currently use.

          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: