How to: Disable the Service Help Page for a Web Service
This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation.
Navigating in a Web browser to the URL for the Web service without any parameters produces an HTML help page, if the page is enabled (which it is by default in a server's machine.config file). The service help page and its configuration are further discussed in Configuration Options for XML Web Services Created Using ASP.NET.
To disable the service help page for an individual Web application
Open the Web.config file in the root directory of the Web application with your favorite editor. (If a Web.config file does not exist, create one.)
webServicessection of Web.config to explicitly remove the Documentation protocol.
<webServices> <protocols> <remove name="Documentation" /> </protocols> </webServices>
This configuration change will take effect on the next request to a Web service hosted by the Web application.
Removing the Documentation protocol also disables WSDL file generation for any Web services within the Web application. This prevents clients from generating a proxy class unless a custom WSDL file is created and provided for them. To leave WSDL file generation on for Web services within a Web application, but not provide any human readable information regarding the Web services, you can add an <wsdlHelpGenerator> element to the Web.config file for the Web application and set the href attribute to a blank HTML page you have created. The following code example is an excerpt of a Web.config file that sets the service help page to a
MyBlank.htmfile in the
docsfolder beneath the folder containing the Web.config file.
<webServices> <wsdlHelpGenerator href="docs/MyBlank.htm"/> </webServices>