Fetching the WSDL from my SharePoint 2010 server, it appears that in the WSDL definitions the schemas lack any substance on the type of the returns. Here would be an example:
<s:element name="GetListItemsResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="GetListItemsResult"> <s:complexType mixed="true"> <s:sequence> <s:any /> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element>
So this basically says that the response could be just about anything. Which of course we know is not right, the Microsoft documentation provides details on what a valid response is and what it can contain.
The trouble here is that when the WSDL doesn't come with good schemas, of course you can't generate bindings for any programming language to those schemas, and the code you write to parse responses ends up being just generic DOM processing code that has to make a lot of assumptions about the response structure.
What's the best practice for generating stubs for SharePoint WSDL schemas, and why are the schemas that are coming back so weak?