Why are the smallest bugs in the .NET framework always the most disproportionately frustrating? Take the wsdlHelpGenerator element, for example. Sure, it seems straightforward enough; you want to replace the default crappy, random hash sorted list of Web Service methods with one that's (shock!) in alphabetical order. I know, it's crazy talk, but bear with me. So you'd...
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\DefaultWsdlHelpGenerator.aspx file
CustomWsdlHelpGenerator.aspx and place it in the root of your Web Service solution
Hashtable methodsTable with SortedList methodsTable
Web.config to include the following:
<webServices> <wsdlHelpGenerator href="CustomWsdlHelpGenerator.aspx" /> </webServices>
And it works great! Well, as long as you deploy your Web Service to a subfolder under the webroot (eg, http://staging.company.com/mywebservice/). However. If you deploy this very same code to a root URL (eg, http://mywebservice.company.com/, you get this exciting, ultra-fatal error:
Configuration ErrorDescription: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Exception in configuration section handler.
This makes deploying to production a lot more, uh, thrilling than it would otherwise be. Commenting the wsdlHelpGenerator line out "fixes" the problem. So does moving the webservice to a subfolder under the root.
This egregious bug in the .NET framework really pisses me off, particularly since it has persisted into 1.1 SP1. I can find lots of people complaining about this in Google Groups, but I can't find one single workaround. Can you? Class? Bueller? Bueller?
Posted by Jeff Atwood View blog reactions
« Checksums and Hashes Raleigh Code Camp Tomorrow »
I was going to try to be glib and recommend a Response.Redirect, but I thought I'd better look it up first :)
This looked important, but I don't know whether it's what you're hitting (the file path bit):
Remarks
...
The value of href is a file path, not a URL. The file path can be relative or absolute. If it is relative, it is relative to the location of the configuration file.
I can't get any combination of path to work when the web service is running at root ( eg http://webservice.com/ ). I've tried "file.aspx", "x", "/file.aspx", "\file.aspx", "(full c drive path)\aspx." and every other combination. It appears to be a pure bug based on running as root.
Jeff Atwood on April 8, 2005 10:30 AMyou might try URL rewriting??? /whatever.asmx could be "rewritten" to /projName/whatever.asmx, though this doesn't really fix the problem.
Greg on February 27, 2008 10:04 AM| Content (c) 2008 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved. |