If a web service has an empty namespace (
[WebService(Name = "MyWebService", Namespace = "")]
), the application will crash with an
. This occurs on line 156 of WSDLGeneratorBusiness.WSDLGenerator.cs, where you'll find this:
if (ns[ns.Length - 1] != '/')
is the variable holding the namespace (an empty string), so it attempts to access index -1 of the string, which fails.
Changing that line to the following solves the issue:
if (!String.IsNullOrEmpty(ns) && ns[ns.Length - 1] != '/')
While not specifying a namespace may be ill advised, it's handy for generating WSDL to be used for generating proxy classes. Also,
Microsoft's WSE 3.0
supports generating WSDL in this configuration, so some consistency would be nice.