-
1. Re: Schema Validation in JBOSS-WS
thomas.diesler Sep 4, 2006 9:47 AM (in response to king_country2000) -
2. Re: Schema Validation in JBOSS-WS
jthalliley Apr 16, 2007 11:57 AM (in response to king_country2000)We were counting on the JBoss WS stack to validate incoming data against our schemas :-(
Guess I'm putting in my vote to increase the priority of this item.
Thanks,
Tom -
3. Re: Schema Validation in JBOSS-WS
ngtdave Feb 18, 2008 9:40 AM (in response to king_country2000)I built a little validation piece for our WS, if anyone is interested. It's not as cool as it could be if it was built in, but it works. I did it using the validation stuff from xmlbeans and a Handler which extends the GenericSOAPHandler.
The key was to separate the elements to be validated from the WSDL stuff.
So I have 1 WSDL with all the , , , , and stuff in it. But the contents of each of those refer to elements defined in XSDs. The WSDL refers to one XSD which has all the top level operations and parameters defined. That XSD then refers to many other XSDs which have more details. So basically all the stuff to validate resides in XSDs, of which, there is 1 top level XSD referred to by the WSDL.
In my handler, I get the top level xsd from the context and load/compile it using XmlBeans.compileXsd(). Then on each message (handleInbound) I extract the SOAPBody, get the first text node (The payload of the request) and validate it with the compiled schema.
The validation errors coming from xmlbeans aren't always the nicest, but nothing gets through which is invalid. :)
If anyone is interested I could probably dummy up a very simple example and post it.
Hope this helps anyone who needs validation. -
4. Re: Schema Validation in JBOSS-WS
ripper64 Feb 26, 2008 12:54 PM (in response to king_country2000)I need to do this as well. I would like to see your example.
Thanks
Jeff -
5. Re: Schema Validation in JBOSS-WS
ngtdave Feb 29, 2008 11:10 AM (in response to king_country2000)It looks like Mr. Diesler has put some good information in the bug http://jira.jboss.org/jira/browse/JBWS-1172 on how to do this, probably better than the implementation I built. It also looks like he is starting to develop it, so you might just wait to see his implementation.