Validating XML payload from JMS
heyyou Mar 1, 2011 7:50 AMTrying to use the "publish_as_webservice" quickstart as an example for validating inbound message and not getting far.
I was hoping this would be a simple task, but appararently I'm missing something.
All I want to do is read a JMS message ( payload is XML data ) from in bound queue ( which is working ) and
if it passes my validation rules, then print it to the console.
The problem I'm running into is that no matter what the XML data is, its being printed. Its as if the XML data
is not being validated. If the data is not valid, then I want the message to be discarded.
I'm trying to use :
<actions mep="OneWay" outXsd="/validate0.xsd" validate="true">
to perform the validation.
Here is the snippet of code from my jboss-esb.xml:
...
<service category="JMSValidate" name="SimpleListener"
description="JMS validate sample">
<listeners>
<jms-listener name="JMS-Gateway"
busidref="inbound" is-gateway="true" />
<jms-listener name="JMSvalidate"
busidref="internal"/>
</listeners>
<actions mep="OneWay" outXsd="/validate0.xsd" validate="true">
<action name="printMessage"
class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="My JMS Message"/>
<property name="printfull" value="false"/>
</action>
. ..
The validate0.xsd exists in the .ESB file ( if it doesn't, I get error that it can't find the file, so I know its finding it).
The validate0.xsd imports two other files validate1.xsd and validate2.xsd. I've tried using inXsd, that did not
work either.
If I take these same .xsd files are drop them into a MuleESB and WESB configuration, they work fine.
Can someone point to me to clear documentation that explains how I should be declaring my <action> so that
I can validate inbound XML from JMS queue and discard the message if it does not validate.
Thanks