Forum Discussion

BA_Service_Haus's avatar
BA_Service_Haus
Regular Contributor
15 years ago

minOccurs="0" - When is it set?

Hi,

one of our operations returns a sequence of values (list) which should at least have one entry.
To check this we used the Schema-Compliance-Assertion.

But even if the list/sequence was empty, the Assertion was passed.
So I checked the soapUI project file and found that following attribute is assigned to the sequence type: minOccurs="0"

Obviously this means, that 0 ore more entrys are acceptable. But in fact it should be 1 or more.

So could please you tell me, what does this attribute depend on? When do you set it to 0 (zero)? Or do you just read it from the interface description?



Best regards
Nico
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi,

    I already found the "problem" and it had nothing to do with "minOccurs".
    Because the element wasn't nillable, we thought it isn't correct to display it like <element/>.

    But obviously that isn't true. An element can be used like <element/> even if it is not nillable.
    So the "Schema Compliance" assertion works fine here.

    Best regards
    Nico