Search This Blog


Friday, June 26, 2009

The Bugs in wsdl.exe

wsdl.exe is a tool, come bundled with .Net SDK, that allows the generation of XML web services and XML web service clients from WSDL contract files, XSD schemas, and .discomap discovery documents. But unlike other excellent offerings from Microsoft, wsdl.exe is buggy, and is unable to handle a slightly complicated situation, let alone a real world wsdl file.

I've used wsdl.exe, and I spent 2 days of frustrating time to learn about it, wrestled with the bugs-- and I failed to get what I want. I have to write this, and hope that Microsoft people will notice and take action.

The first issue it fails to handle sequence with complex element. You would think that in today's webservice environment, a sequence of complex elements is a norm. But apparently Microsoft doesn't think so, and this results in inability of wsdl.exe to handle a sequence of complex elements.

What if you insist on using wsdl.exe to generate proxy class for element with a sequence of complex types? You will get a cryptic exception:
unable to import binding * from namespace *
- unable to import operation *
- the datatype * is missing
The second bug wsdl has is that it is not permissible to have two web methods that have the same return signature. Yes, if one method returns a type of ComplexType, the other methods must have a different return type. Failing to do so will result in an System.InvalidOperationException: The XML element * from namespace * references a references a method and a type exception.

Note that in both cases the messages are cryptic. You won't actually know what's going on behind the hood. And this is the most frustrating of all. You don't know whether you fail because the tool is lousy, or because you are not doing things right.

I would like to hear suggestion about alternative proxy code generation tool that can really handle a real world wsdl. Any ideas?

No comments: