whummer / jaxb-facets

Support for extended XSD features in JAXB: facets (restrictions on simple types), annotations, asserts, ...
Other
26 stars 18 forks source link

Jaxb-Facets @MaxOccurs generated XML Schema validation not working #26

Closed santhoshkrv closed 9 years ago

santhoshkrv commented 9 years ago

In Jaxb-Facets Given @MaxOccurs(2) for java collection datatype

@MaxOccurs(2) List testList;

But if we give more than 2 data in SOAP UI for testing, operation runs successfully without returning a fault message "Maximum 2 data can be given"

No Schema Validation happening

whummer commented 9 years ago

This is true, JAXB-Facets only generates schema documents for WSDL, but does not enforce the schema restrictions in your Web service calls. What you are asking for does not directly have to do with JAXB - it would have to be implemented in the JAX-WS Web service stack implementation. It should be easy to integrate this as a handler in JAXWS, using the schema validation facilities of JAXB.

Closing this issue, but feel free to update us here on the progress, in case you find out more. Thanks.

pellcorp commented 9 years ago

https://web-gmazza.rhcloud.com/blog/entry/soap-xml-schema-validation