System.Web.Services.Description.ServiceDescriptionImporter.AddServiceDescription Method

Adds the specified System.Web.Services.Description.ServiceDescription to the collection of ServiceDescriptionImporter.ServiceDescriptions values to be imported.

Syntax

public void AddServiceDescription (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)

Parameters

serviceDescription
The System.Web.Services.Description.ServiceDescription instance to add to the collection
appSettingUrlKey
Sets the initial value of the Url property of the proxy class to be generated from the instance represented by the serviceDescription parameter. Specifies that it should be generated from the web.config file's <appsetting> section.
appSettingBaseUrl
Sets the initial value of the Url property of the proxy class to be generated from the instance represented by the serviceDescription parameter. Specifies that it should be constructed from a combination of the value of this parameter and the URL specified by the location attribute in the WSDL document.

Remarks

Use this method to add System.Web.Services.Description.ServiceDescription instances to the collection that is to be imported when the ServiceDescriptionImporter.Import(System.CodeDom.CodeNamespace, System.CodeDom.CodeCompileUnit) method is called.

The two string parameters, appSettingUrlKey and appSettingBaseUrl, specify how to construct the Url property of the XML Web service proxy that is to be generated from the imported System.Web.Services.Description.ServiceDescription value. The appSettingUrlKey parameter specifies that the Url property should be read out of the web.config file's <appsettings> section by using the parameter value as the configuration key. If the appSettingUrlKey parameter is null or an empty string, the initial value is determined by the location attribute in the Web Services Description Language (WSDL) document. If the value of ServiceDescriptionImporter.Style is Server, an error is raised if you attempt to set the value of the appSettingUrlKey parameter.

The appSettingBaseUrl parameter specifies that the initial value for the Url property should be constructed from a combination of this parameter value and the URL specified by the location attribute in the WSDL document. The appSettingUrlKey parameter must also be specified. The Url property is constructed by combining a relative URL (constructed from the appSettingBaseUrl parameter and the WSDL-specified URL) with the URL loaded from the web.config file. If this parameter is null or an empty string, the URL is constructed entirely from the value in the web.config file.

Requirements

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in System.Web.Services.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0