title: Validate soap requests against schema in a JAX-WS code-first approach
body: <p>I created a JAX-WS webservice, using JAXB annotations on some request fields to make them mandatory.</p>
  
  <pre><code>@XmlElement(required = true)
  protected String number;
  </code></pre>
  
  <p>The WSDL generated by cxf-java2ws-plugin is correct, there is no <code>minOccurs="0"</code> on the fields :</p>
  
  <pre><code>&lt;xs:element name="number" type="xs:string"/&gt;
  </code></pre>
  
  <p>But when the service receives a request that does not respect these constraints (missing fields), no SoapFault or exception is thrown.</p>
  
  <p>I also tried adding <code>@SchemaValidation</code> to my WS class, with no effect.</p>
  
  <p>How request validation against schmema (or rather validation against annotation-based constraints) can be automated?</p>