Defining length restriction in Java Bean
I find myself in quite a predicament in a project using JAX-WS to expose our services as SOAP endpoints.
We have defined a series of services with the corresponding Beans (all programatically), and let JAX-WS dinamically generate the WSDL and XSD based on the annotations in the beans.
The problem is that we would like to be able to validate the length of some of the fields.
Is there any way that I can pass this information to JAX-WS (through annotatations or otherwise), so that this ends up in the XSD?
My first approach was try to find some annotation that would let me define the length, just the same way one can define a
to limit a field to a set of values, or even
@XmlElement(name="myelement", required = false)
Is there any way I can complement this so that the lengths of the fields are validated in the SOAP request?
Thank you in advance!