[jboss-user] [JBossWS] - Re: No tests for @SchemaValidation annotation in 3.0.1 ?

anaholzbach do-not-reply at jboss.com
Mon Aug 4 16:39:53 EDT 2008


Hi,

To answer ljgp ("does the schema validation feature really work?"), I've implemented a service endpoint that uses SchemaValidation and it seems to work. I started with an xsd, generated jaxb objects from it and implemented my endpoint using those jaxb objects and the @WebService and @WebMethod annotations. Upon deployment the WSDL was automatically generated. Then I added the @SchemaValidation tag and ran into problems with multiple schema elements and multiple namespaces, because the generated wsdl had one schema for the jaxb objects and another one (with a different namespace) for binding, service, message, portType, etc. I solved that by editing the wsdl to consolidate everything into one schema tag with one namespace and added that edited wsdl locally to my application under META-INF/wsdl. I also had to add minOccurs=1 and maxOccurs=1 in places, since the wsdl's schema ended up with less information than my original schema. 

A call to this webservice with a message that does not conform to the schema results in an Exception which is thrown by the StrictlyValidErrorHandler and wrapped in a SOAP Fault - something like:

 org.xml.sax.SAXException: cvc-complex-type.2.4.b: The content of element 'specimen' is not complete. One of '{specimen_id}' is expected.
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168580#4168580

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168580



More information about the jboss-user mailing list