title: Writing C# client to consume a Java web service that returns array of objects
body: <p>I am writing a C# client that calls a web service written in Java (by another person).  I have added a web reference to my client and I'm able to call methods in the web service ok.</p>
  
  <p>The service was changed to return an array of objects, and the client does not properly parse the returned SOAP message.</p>
  
  <pre><code>MyResponse[] MyFunc(string p)
  
  class MyResponse
  {
      long id;
      string reason;
  }
  </code></pre>
  
  <p>When my generated C# proxy calls the web service (using SoapHttpClientProtocol.Invoke), I am expecting a MyResponse[] array with length of 1, ie a single element.  What I am getting after the Invoke call is an element with id=0 and reason=null, regardless of what the service actually returns.  Using a packet sniffer, I can see that the service is returning what appears to be a legitimate soap message with id and reason set to non-null values.</p>
  
  <p>Is there some trick to getting a C# client to call a Java web service that returns someobject[] ?  I will work on getting a sanitized demo if necessary.</p>
  
  <p><strong>Edit</strong>: This is a web reference via "Add Web Reference...".  VS 2005, .NET 3.0.</p>