The .NET Framework generates a service help page when accessing the asmx page for a Web service. This page lists the Web methods exposed by the Web service, but doesn't list these methods in the order they appear in the source code. This tip describes a minor modification which keeps Web methods in source code sequence.
The service help page is generated by DefaultWsdlHelpGenerator.aspx in
\%WINDOWS%
\Microsoft.NET
\Framework
\[version]
\CONFIG
DefaultWsdlHelpGenerator.aspx uses a Hashtable to store the Web methods. Replace the Hashtable with a ListDictionary (in the System.Collections.Specialized namespace) as follows:
- Open DefaultWsdlHelpGenerator.aspx
- Search for 'Hashtable methodsTable' in the line which reads
'Hashtable methodsTable = new Hashtable();'
- Change both occurrences of 'Hashtable' to:
'System.Collections.Specialized.ListDictionary' so that the line reads
'System.Collections.Specialized.ListDictionary methodsTable = new
System.Collections.Specialized.ListDictionary();'
- Save the file.
Every service help page will now list Web methods in source code sequence.