title: Differing .NET XML serializer behavior when deserializing missing integers
body: <p>I recently hit a problem with a SOAP web service where the WSDL specifies an integer for a particular field, but the XML comes in with an empty element which causes the .NET deserialization logic to throw a FormatException.</p>
  
  <p>The WSDL looks like this:</p>
  
  <pre><code>&lt;xsd:element minOccurs="0" maxOccurs="1" name="TransID" type="xsd:int" /&gt;
  </code></pre>
  
  <p>And the SOAP looks like this:</p>
  
  <pre><code>&lt;TransID&gt;&lt;/TransID&gt;
  </code></pre>
  
  <p>This causes the exception when parsing the response.  The server I'm talking to belongs to a vendor so I don't have the option to change it.  I'm hacking around this in the short term by redefining the field as a string.</p>
  
  <p>My question is this: In trying to diagnose this problem, I pulled out the XML into a file and created my own XmlSerializer to test deserializing using the POCO's generated by the WSDL import.  The XmlSerializer I created parses this XML just fine and produces the parent type as expected.  No exception.  The field value is zero which would be expected.  Why does the SOAP deserializer puke and the plain deserializer I created works fine?</p>