Details
Description
Validating a SOAP request or response with PayloadValidatingInterceptor or Jaxb2Marshaller fails when using MTOM.
The spring-ws MTOM sample fails when PayloadValidatingInterceptor is added to the endpoint interceptor chain.
Schema:
<element name="SendRequest" type="tns:SendMessage"/>
<complexType name="SendMessage">
<sequence>
<element name="sender" type="string"/>
<element name="recipient" type="string"/>
<element name="content" type="base64Binary" xmime:expectedContentTypes="/"/>
</sequence>
</complexType>
SOAP request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mail="http://www.enovation.nl/ems/mailwebservice">
<soapenv:Header/>
<soapenv:Body>
<mail:SendRequest>
<mail:sender>1</mail:sender>
<mail:recipient>2</mail:recipient>
<mail:content><inc:Include xmlns:inc="http://www.w3.org/2004/08/xop/include" href="cid:768176637073"/></mail:content>
</mail:SendRequest>
</soapenv:Body>
</soapenv:Envelope>
SOAP 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-type.3.1.2: Element 'mail:content' is a simple type, so it must have no element information item [children].</spring-ws:ValidationError>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>