Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java XML Validation and MTOM

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?

like image 203
Sivasubramaniam Arunachalam Avatar asked May 13 '26 07:05

Sivasubramaniam Arunachalam


1 Answers

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.

like image 155
Sivasubramaniam Arunachalam Avatar answered May 14 '26 21:05

Sivasubramaniam Arunachalam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!