Click to Rate and Give Feedback
MSDN
MSDN Library
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Developer's Guide
How to: Disable the Service Help Page for a Web Service
[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

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

  1. 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.)

  2. Modify the webServices section of Web.config to explicitly remove the Documentation protocol.

    <webServices>
         <protocols>
           <remove name="Documentation" />
         </protocols>
    </webServices>
  3. Save Web.config.

    This configuration change will take effect on the next request to a Web service hosted by the Web application.

    NoteNote:

    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.htm file in the docs folder beneath the folder containing the Web.config file.


    <webServices>
       <wsdlHelpGenerator href="docs/MyBlank.htm"/>
    </webServices>
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker