Skip to content

PayloadValidatingInterceptor refuses to validate correct message with a top-level attribute [SWS-232] #382

Closed
@gregturn

Description

@gregturn

John Cater opened SWS-232 and commented

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.


Affects: 1.0.2

Attachments:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions