0
votes

I'm using schema validation component for xml validation.

In my scenario xml comes from JMS queue and need to place in other JMS queue in between I need to validate incoming xml whether it is proper or not by XSD Schema.

but when I put logger after Schema Validation component it is not logging( logging as[#document: null]) xml even input xml is as per XSD Schema.

<mulexml:schema-validation-filter name="Schema_Validation" schemaLocations="C:\src\test\resources\Orders.xsd" returnResult="true" doc:name="Schema Validation" />
<logger message="content is #[payload]" level="INFO" doc:name="Logger"/>

Please suggest me on this., Thanks...,

2
Given your config xml, if your xml is not valid, it will stop processing which explains it does not log. But if is indeed valid, the log should have executed. - Avanaur
Hi Tyrone, I have generated input xml from XSD Schema itself so my input xml is proper moreover when I give improper XML as input it is throwing error message i.e logger is not executed. when ever I give proper XML only flow is moving forward and logging : [#document: null]. - Thiru
Do as Franck said so your payload remains the same before filter. What are you are getting is already a DOM class that's why [#document: null]. If you want to process filtered (invalid XML), there's a config for it, mix of global schema filter and message filter. - Avanaur
Have u tried <mulexml:dom-to-xml-transformer /> right after validation filter and before logger ? - tortoise

2 Answers

0
votes

Do you get a stacktrace? Can you set a logger directly after the JMS endpoint and validate whether it is a correct message or not? Is it a nested schema?

0
votes

In order to allow a valid XML to pass the filter you need to set the returnResult to false in your schema-validation-filter. This way the payload of the message that is passed onwards to the next element in your flow will retain the XML content.