title: XML Serialization issue for minoccurs
body: <p>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:</p>
  
  <pre><code>&lt;xsd:complexType name="Optional"&gt;
   &lt;xsd:sequence&gt;
    &lt;xsd:element name="FromAmount" nillable="true" type="xsd:float" minOccurs="0" /&gt; 
    &lt;xsd:element name="ToAmount" nillable="true" type="xsd:float" minOccurs="0" /&gt; 
    &lt;xsd:element name="FromDate" nillable="true" type="xsd:dateTime" minOccurs="0" /&gt; 
    &lt;xsd:element name="ToDate" nillable="true" type="xsd:dateTime" minOccurs="0" /&gt; 
    &lt;xsd:element name="FromCheckNumber" nillable="true" type="xsd:long" minOccurs="0" /&gt; 
    &lt;xsd:element name="ToCheckNumber" nillable="true" type="xsd:long" minOccurs="0" /&gt; 
   &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>How do I get these elements to be optional, but to serialize when a value is assigned to them?</p>
  
  <p>Thanks in advance for your help.</p>