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.
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.
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.
I am looking for suggestions how to locate the problem - I've tried the following:
- Compare the XML returned by the webservice using a TCP/IP monitor: The XML looks identical C# vs. Java and contains the 50 products
- 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
- Try SOAP 1.2 instead of SOAP 1.1: No effect
- Try HttpGetProtocol, HttpPostProtocol instead of Soap
Any suggestions are highly appreciated.
EDIT: Full WSDL and generated code (Reference.cs) can be found here:
http://timmay.dk/Reference.txt
http://timmay.dk/Wsdl.txt
Simplified WSDL part:
<s:element name="Search">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SearchTerm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StartFrom" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="NumberToBeReturned" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SearchResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SearchResult" type="tns:SearchResult" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="SearchResult">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Products" type="tns:ArrayOfResponseProduct" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfResponseProduct">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="ResponseProduct" nillable="true" type="tns:ResponseProduct" />
</s:sequence>
</s:complexType>
<s:complexType name="ResponseProduct">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Fields" type="tns:ArrayOfResponseField" />
</s:sequence>
<s:attribute name="id" type="s:string" />
</s:complexType>