I have a .NET Web app which consumes a Java-based Web service. One of the objects, named Optional, contains search criteria fields. The schema is the following:
<xsd:complexType name="Optional">
<xsd:sequence>
<xsd:element name="FromAmount" nillable="true" type="xsd:float" minOccurs="0" />
<xsd:element name="ToAmount" nillable="true" type="xsd:float" minOccurs="0" />
<xsd:element name="FromDate" nillable="true" type="xsd:dateTime" minOccurs="0" />
<xsd:element name="ToDate" nillable="true" type="xsd:dateTime" minOccurs="0" />
<xsd:element name="FromCheckNumber" nillable="true" type="xsd:long" minOccurs="0" />
<xsd:element name="ToCheckNumber" nillable="true" type="xsd:long" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
The problem that I am running into is that the child elements will not serialize even when a value is assigned to them in the Web app. If I remove the minOccurs attribute, then all is well.
How do I get these elements to be optional, but to serialize when a value is assigned to them?
Thanks in advance for your help.