Share via


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

In Application Designer, you can disable or enable WSDL file generation for all Web services on an ASP.NET application. By default, WSDL file generation is enabled on an ASP.NET application. 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 the ASP.NET application is implemented, you can also remove or add the appropriate setting in the Web.config file, 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 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. 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