I created a JAX-WS webservice, using JAXB annotations on some request fields to make them mandatory.
@XmlElement(required = true)
protected String number;
The WSDL generated by cxf-java2ws-plugin is correct, there is no minOccurs="0"
on the fields :
<xs:element name="number" type="xs:string"/>
But when the service receives a request that does not respect these constraints (missing fields), no SoapFault or exception is thrown.
I also tried adding @SchemaValidation
to my WS class, with no effect.
How request validation against schmema (or rather validation against annotation-based constraints) can be automated?
cvc-complex-type.2.4.a: Invalid content was found starting with element 'email'. One of '{pwd}' is expected
– Charleencharlemagneorg.apache.cxf.annotations.SchemaValidation
worked – Charleencharlemagne