title: Debug C# webservice client
body: <p>I ran into a strange problem using a C# webservice client to call a ASP.NET 2.0 webservice.
  The service is a simple product search and returns an array of products matching a search term - see the relevant part of the WSDL file below.<br>
  My C# client is simply generated by adding a web reference in VS2010 (non-WCF) and for comparison I'm using an Axis 1.4 Java client.<br>
  Using the same search paramaters in both the C# and the Java client the call returns 50 products but in the C# client the result array has length 1 while the Java client shows up the correct 50 elements.</p>
  
  <p>I am looking for suggestions how to locate the problem - I've tried the following:  </p>
  
  <ul>
  <li>Compare the XML returned by the webservice using a TCP/IP monitor: The XML looks identical C# vs. Java and contains the 50 products</li>
  <li>Compare HTTP parameters using netcat: C# defaults to HTTP 1.1 while Axis 1.4 uses HTTP 1.0, but changing the C# client to use HTTP 1.0 as well does no change anything</li>
  <li>Try SOAP 1.2 instead of SOAP 1.1: No effect</li>
  <li>Try HttpGetProtocol, HttpPostProtocol instead of Soap</li>
  </ul>
  
  <p>Any suggestions are highly appreciated.</p>
  
  <hr>
  
  <p>EDIT: Full WSDL and generated code (Reference.cs) can be found here:<br>
  <a href="http://timmay.dk/Reference.txt" rel="nofollow noreferrer">http://timmay.dk/Reference.txt</a><br>
  <a href="http://timmay.dk/Wsdl.txt" rel="nofollow noreferrer">http://timmay.dk/Wsdl.txt</a></p>
  
  <p>Simplified WSDL part:</p>
  
  <pre><code>      &lt;s:element name="Search"&gt;
      &lt;s:complexType&gt;
        &lt;s:sequence&gt;
          &lt;s:element minOccurs="0" maxOccurs="1" name="SearchTerm" type="s:string" /&gt;
          &lt;s:element minOccurs="0" maxOccurs="1" name="StartFrom" type="s:string" /&gt;
          &lt;s:element minOccurs="0" maxOccurs="1" name="NumberToBeReturned" type="s:string" /&gt;
        &lt;/s:sequence&gt;
      &lt;/s:complexType&gt;
    &lt;/s:element&gt;
    &lt;s:element name="SearchResponse"&gt;
      &lt;s:complexType&gt;
        &lt;s:sequence&gt;
          &lt;s:element minOccurs="0" maxOccurs="1" name="SearchResult" type="tns:SearchResult" /&gt;
        &lt;/s:sequence&gt;
      &lt;/s:complexType&gt;
    &lt;/s:element&gt;
    &lt;s:complexType name="SearchResult"&gt;
      &lt;s:sequence&gt;
        &lt;s:element minOccurs="0" maxOccurs="1" name="Products" type="tns:ArrayOfResponseProduct" /&gt;
      &lt;/s:sequence&gt;
    &lt;/s:complexType&gt;
    &lt;s:complexType name="ArrayOfResponseProduct"&gt;
      &lt;s:sequence&gt;
        &lt;s:element minOccurs="0" maxOccurs="unbounded" name="ResponseProduct" nillable="true" type="tns:ResponseProduct" /&gt;
      &lt;/s:sequence&gt;
    &lt;/s:complexType&gt;
    &lt;s:complexType name="ResponseProduct"&gt;
      &lt;s:sequence&gt;
        &lt;s:element minOccurs="0" maxOccurs="1" name="Fields" type="tns:ArrayOfResponseField" /&gt;
      &lt;/s:sequence&gt;
      &lt;s:attribute name="id" type="s:string" /&gt;
    &lt;/s:complexType&gt;
  </code></pre>