The number of occurrences of an element can be controlled using the properties Min Occurs and Max Occurs. Using these properties, an element can be defined as mandatory, optional or repeating.
A mandatory element has Min Occurs>= 1. A mandatory element must occur at least once in an input message.
An optional element has Min Occurs = 0. An optional element can be omitted from the input message.
A repeating element has Max Occurs> 1 or Max Occurs=-1, which indicates that an unlimited number of repeats are allowed. A repeating element can occur more than once in the input message, and all the occurrences must appear together without any other elements between them.
If a complex type or a group contains two, or more, members that refer to the same element, the second reference is a duplicate. This is different from a repeating element, because the two references are typically separated by other members of the type or group. In the input message, the second occurrence typically does not appear immediately after the first occurrence. Duplicate element references are not allowed within types and groups that have compositions of Choice, OrderedSet, or UnorderedSet.
The number of occurrences of an attribute can be controlled by setting it to required, optional or prohibited.
A required attribute is similar to a mandatory element - it must occur in the input message.
An optional attribute is similar to an optional element - it can be omitted from the input message.
A prohibited attribute must not appear in the input message.
An attribute is not allowed to repeat, and duplicate attribute references are not allowed within an attribute group.