Question

Does Java XML Validation Support MTOM enabled Messages? The following error has been thrown during validation.

cvc-type.3.1.2: Element 'ns2:myblobData' is a simple type, so it must
have no element information item [children]

But the validation passes if the message sent without MTOM.

Any Ideas?

Was it helpful?

Solution

If MTOM is enabled, the web service client/server will convert content of all the base64Binary type fields into individual attachments(called as xop includes). Since XML validation expects the content during validation, it will encounter only the xop include tag (as a child tag). So it couldn't validate the payload, it will throw the given error.

In order to avoid the error, the xop includes should be resolved before invoking the XML validation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top