devxlogo

Preserve the Sequence of Web Methods

Preserve the Sequence of Web Methods

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:

  1. Open DefaultWsdlHelpGenerator.aspx
  2. Search for ‘Hashtable methodsTable’ in the line which reads
    'Hashtable methodsTable = new Hashtable();'
  3. Change both occurrences of ‘Hashtable’ to:
  4. 'System.Collections.Specialized.ListDictionary' so that the line reads'System.Collections.Specialized.ListDictionary methodsTable = newSystem.Collections.Specialized.ListDictionary();'
  5. Save the file.

Every service help page will now list Web methods in source code sequence.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist