views:

573

answers:

0

I am experiencing an issue with WSDL schema validation failing when my web service response contains an MTOM attachment. After searching the web I see I'm not the only one with this problem but have not found any solutions.

It seems to fail because the web service response contains an xop:Include element similar to the following, which isn't specifically defined in the wsdl:

RESPONSE:

<renderedResult>
  <xop:Include href="cid:b2acbc57-2c18-4a3f-b3cc-03f046c5c32c%40null"
            xmlns:xop="http://www.w3.org/2004/08/xop/include"/&gt;
</renderedResult>

WSDL:

<xsd:sequence>
  <xsd:element name="renderedResult" type="xsd:base64Binary"/>
</xsd:sequence>

When I try to validate the response using SOAP UI validation tool (Alt-V) I get the error message: "Element not allowed: Include@http://www.w3.org/2004/08/xop/include in element renderedResult"

Can anyone offer any help on how to get schema validation working when using MTOM for attachments?

EDIT

So it appears that this is a known issue that no one plans to fix! jira.springframework.org/browse/SWS-242

So what do people do in this scenario? Do you just not use schema validation and hope for the best???