I want to know how to make the below fields as mandatory and optional field in xsd declaration.
In the AccDetailsRequest i want USERNAME and EMAIL as mandatory field and PHONE as optional field.
<xsd:element name="AccDetailsRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="USERNAME" type="xsd:string"/>
<xsd:element name="EMAIL" type="xsd:string"/>
<xsd:element name="PHONE" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Appreciate your help
Thanks
You should use
minOccurs
andmaxOccurs
. their default values are 1. try the following: