ASP.NET.in.a.Nutshell.Second.Edition [Electronic resources]

G. andrew Duthie; matthew Macdonald

نسخه متنی -صفحه : 873/ 297
نمايش فراداده

ServiceDescriptionImporter

System.Web.Services.Description (system.web.services.dll)class

The ServiceDescriptionImporter is used to programmatically create a proxy class for a web service. Clients invoke web service methods by creating an instance of the proxy class and invoking the corresponding method on the proxy class.

To create a proxy class, first use the AddServiceDescription( ) method to add a ServiceDescription to the ServiceDescriptions collection. Then create the proxy class with the Import( ) method.

When using the AddServiceDescription( ) method, use the appSettingUrlKey and appSettingBaseUrl parameters to specify how the Url property will be generated for the web service proxy class.

public class 

ServiceDescriptionImporter { // Public Constructors public

ServiceDescriptionImporter ( ); // Public Instance Properties public string

ProtocolName {set; get; } public XmlSchemas

Schemas {get; } public ServiceDescriptionCollection

ServiceDescriptions {get; } public ServiceDescriptionImportStyle

Style {set; get; } // Public Instance Methods public void

AddServiceDescription (ServiceDescription

serviceDescription , string

appSettingUrlKey , string

appSettingBaseUrl ); public ServiceDescriptionImportWarnings

Import (System.CodeDom.CodeNamespace

codeNamespace , System.CodeDom.CodeCompileUnit

codeCompileUnit ); }