title: C# client for Java Web Service - data interoperability issue
body: <p>I have Java Web service , and a parameter to one web method is a custom Java type </p>
  
  <pre><code>public class KeyList {
  public Integer key;
  public Integer[] nums ;
  public Integer result;
  }
  </code></pre>
  
  <p>The Web service updates the Result value and returns the KeyList object to the client.</p>
  
  <p>I have a C# client to this Web service ( generated in Visual Studio by adding Service Reference and pointing to the wsdl url ). When I receive the keyList object in C# , the first part ( Integer key ) comes out as 0.
  If I change the Java custom type to use int key ( rather than Integer Key ) in the KeyList type , then it works fine for the C# client.</p>
  
  <p>I wanted to see if the wsdl was drastically different between the two cases ( using int and Integer ) , but it turns out that the only difference is a minOccurs attribute.</p>
  
  <p>when using Integer key </p>
  
  <pre><code>&lt;xs:element name="key" type="xs:int" minOccurs="0" /&gt; 
  </code></pre>
  
  <p>when using int key </p>
  
  <pre><code>&lt;xs:element name="key" type="xs:int" /&gt; 
  </code></pre>
  
  <p>What is the cause for the C# client not correctly receiving the updated Integer in the return value from the service ? Needless to say it works fine for a Java client either way.</p>
  
  <hr>
  
  <p>Edit :
  C# class generated by VS for KeyList :</p>
  
  <p>public class keyList : INotifyPropertyChanged{</p>
  
  <pre><code>private int keyField;
  private bool keyFieldSpecified;
  
  private int?[] numsField;
  private PropertyChangedEventHandler PropertyChanged;
  private int resultField;
  private bool resultFieldSpecified;
  
  public event PropertyChangedEventHandler PropertyChanged;
  
  public keyList();
  protected void RaisePropertyChanged(string propertyName);
  
  [XmlElement(Form=XmlSchemaForm.Unqualified, Order=0)]
  public int key { get; set; }
  [XmlElement("nums", Form=XmlSchemaForm.Unqualified, IsNullable=true, Order=1)]
  public int?[] nums { get; set; }
  [XmlElement(Form=XmlSchemaForm.Unqualified, Order=2)]
  public int result { get; set; }
  [XmlIgnore]
  public bool resultSpecified { get; set; }
  </code></pre>
  
  <p>}</p>