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

PayloadValidatingInterceptor refuses to validate correct message with a top-level attribute

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.5 M1, 1.0.3
    • Component/s: XML
    • Labels:
      None
    • Environment:
      Java 1.6.0_03 on amd64 linux
      Running in JBoss 4.2.0.ga

      Description

      With the following schema:
      <element name="EchoMessageRequest">
      <complexType>
      <attribute name="message" type="string"/>
      </complexType>
      </element>

      I attempt to submit the message:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.example.com/soap-test/schemas">
      <soapenv:Header/>
      <soapenv:Body>
      <sch:EchoMessageRequest message="hello world"/>
      </soapenv:Body>
      </soapenv:Envelope>

      And I get the response:
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Header/>
      <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Client</faultcode>
      <faultstring xml:lang="en">Validation error</faultstring>
      <detail>
      <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-complex-type.3.2.2: Attribute 'message' is not allowed to appear in element 'sch:EchoMessageRequest'.</spring-ws:ValidationError>
      </detail>
      </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      I wrote a small handler that takes XML and attempts to validate it against the same schema the PayloadValidatingInterceptor uses, and it reports no problem.

      I am attaching a minimal project which reproduces this issue. I used SOAPui to test but this seems to be independent of the client.

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              katre John Cater
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: