Tuesday, November 18, 2008

Bug in Visual Studio 2008 WSDL Interpreter

When I started working with Flat-WSDL we soon came to a phenomenon where our list types suddenly become converted to

ArrayType[]

instead of

List<arraytype>

It took a while to drill down the cause to the following.

A common wsdl:types section looks like this:

<wsdl:types>
<xsd:schema>
</xsd:schema ....>
<xsd:schema>
</xsd:schema ....>
</wsdl:types>

but whenever there is the following section in the WSDL

<wsdl:types>
<xsd:schema ....>
</xsd:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ....>
</xs:schema>
</wsdl:types>

you can not switch the ListTypes anymore. They will all be ArrayType[] . This applies for the ServiceReference as well as for svcutil that simply ignores the /ct: Parameter .

Both WSDL descriptions are perfectly valid as both tokens xsd: and xs: reference the http://www.w3.org/2001/XMLSchema Namespace and hence are synonyms.

I reported the bug to Microsoft using Connect (MSConnect ID:387245). But I heavily disagree with their answer, which basically says "It's not a bug it's a feature". You should find some samples wsdls there.

No comments: