Share via


How to: Control WSDL File Generation for ASP.NET Web Services

You can disable or enable WSDL file generation for all Web services on an ASP.NET application when you are working with Application Designer in Visual Studio Team System Architecture Edition. By default, Visual Studio enables WSDL file generation. For more information, see WSDL File Generation for ASP.NET Web Services.

Note

Disabling or enabling WSDL file generation applies to all Web services on an ASP.NET application. Disabling WSDL file generation without specifying another location for the WSDL file prevents Web reference generation and results in an error that a WSDL file could not be found at the specified location. Disabling WSDL file generation also disables the default ASP.NET test page produced when accessing the Web service URL from a browser. For more information, see How to: Override WSDL Binding Definitions in WSDL Files.

You can accomplish this task prior to implementation by using the Settings and Constraints Editor. Once you implement the ASP.NET application, you can also remove or add the appropriate setting in the Web.config file, which is located in the application project or in the Machine.config file of the Web server on which the application will deploy, depending on the scope that you want.

To disable WSDL file generation for an ASP.NET application

  1. On the application diagram, click the ASP.NET application you want.

  2. On the Diagram menu, choose Settings and Constraints.

  3. Under Settings in the Settings and Constraints Editor, expand the Directory node and then the Configuration node.

  4. Right-click the Configuration node, point to Add Resource, and choose SystemWebSectionGroup.

  5. Right-click the SystemWebSectionGroup node, point to Add Resource, and choose WebServicesSection.

  6. In the right pane of the Settings and Constraints Editor, expand the Settings node.

  7. On the Protocols row, click the Value column, and then the ellipsis () button.

    The ComplexSetting Collection Editor appears.

  8. In the Members list, select Documentation, click Remove, and then OK.

    The following entry is omitted from the <System.Web> section in the application's Web.config configuration file, which is generated once the application is implemented:

    <add name="Documentation" />
    

    You can also remove this entry from the Web server's Machine.config file to disable WSDL file generation for all ASP.NET applications on that server.

To enable WSDL file generation for an ASP.NET application

  1. On the diagram, select the ASP.NET application you want.

  2. On the Diagram menu, choose Settings and Constraints.

  3. Under Settings in the Settings and Constraints Editor, expand the Directory node and then the Configuration node.

  4. Expand the SystemWebSectionGroup node and select the WebServicesSection resource.

  5. In the right pane of the Settings and Constraints Editor, expand the Settings node.

  6. On the Protocols row, click the Value column, and then the ellipsis () button.

    The ComplexSetting Collection Editor appears.

  7. In the ComplexSetting Collection Editor, click Add.

    In the Members list, a new setting appears.

  8. In the setting properties list, name the setting "Documentation", and click OK.

    The following entry is added to the <System.Web> section in the application's Web.config configuration file, which is generated once the application is implemented:

    <add name="Documentation" />
    

    You can also add this entry to the Web server's Machine.config file to enable WSDL file generation for all ASP.NET applications on that server.

See Also

Other Resources

Configuring WSDL File Generation for ASP.NET Web Services