title: CXF - How to declare an attribute required and non-primitive?
body: <p>I have a web sercice method that recieves an object. One of the attributes is "interval" which is an integer.</p>
  
  <p>I would like to make this atribute required but without providing any default value - I want the user to be required to explicitly set a value.</p>
  
  <p>If I use <code>int interval</code> - the attribute is exposed as int and if the user does not explicitly set the attribute, a zero (Java default for primitive int) will be sent.</p>
  
  <p>If I use <code>Integer interval</code> - the attribute is exposed as Integer and is declared optional in the WSDL so the user can't see it is required before sending the request.</p>
  
  <p>If I use <code>Integer interval</code> with <code>@XmlElement(required = true)</code> or <code>@XmlElement(nillable = false)</code> - the attribute is exposed as int.</p>
  
  <p>The attribute can have any integer - negative, zero and positive so I can't use a default value to indicate that the attribute was not explicitly set.</p>
  
  <p>I can use <code>BigInteger interval</code> with <code>@XmlElement(required = true)</code> but than we are missing the advantages of using the core type Integer.</p>
  
  <p>I would like to expose the attribute as Integer so I will get null if the user did not set the attribute and at the same time I would like the WSDL to expose that the attribute is required so users will know it is required simply by looking at the WSDL.</p>