According to documentation for xs elements,it is not required to have minOccurs and maxOccurs set to "1",as "1" is default values for minOccurs and maxOccurs .
I am using my XSD for Webservice.When compile and run it,It does not show any validation for mandatory/required fields.It just pass through as if there is no mandatory check.I have alreay set minOccurs and maxOccurs to "1",It should give me some kind of validation,if I do not provide value for it.Am I right? Why its not taking consideration of this?
What changes I need to make RequestType mandatory or required in XSD?
When I go to generated class it shows as given below
@XmlElement(required = true)
protected Type requestType;
What is to be done for making this element mandatory and when I call without having value assigned to it,it should warn that this element is mandatory.
[edit by moderator: changed from all caps subject line to mixed case]
I assume that JAXB is responsible for marshalling and unmarshalling XML data and thus also responsible for validating the data.
You can try by trying to unmarshall some XML data which is incomplete.
For an example program, see page 288 in http://www.slideshare.net/krizsan/scdjws-5-study-notes-3085287 I am not entirely certain whether validation is turned on by default.
Joined: Feb 01, 2003
Everthing is working fine.I could use these elements to get and set values and also I am able to get simple type on it.