WebReference Constructors

Definitie

Initialiseert een nieuw exemplaar van de WebReference klasse.

Overloads

Name Description
WebReference(DiscoveryClientDocumentCollection, CodeNamespace)

Initialiseert een nieuw exemplaar van de WebReference klasse met de opgegeven beschrijvingsdocumentverzameling en proxycodenaamruimte.

WebReference(DiscoveryClientDocumentCollection, CodeNamespace, String, String)

Initialiseert een nieuw exemplaar van de WebReference klasse met de opgegeven gegevens.

WebReference(DiscoveryClientDocumentCollection, CodeNamespace, String, String, String)

Initialiseert een nieuw exemplaar van de WebReference klasse met de opgegeven gegevens.

WebReference(DiscoveryClientDocumentCollection, CodeNamespace)

Initialiseert een nieuw exemplaar van de WebReference klasse met de opgegeven beschrijvingsdocumentverzameling en proxycodenaamruimte.

public:
 WebReference(System::Web::Services::Discovery::DiscoveryClientDocumentCollection ^ documents, System::CodeDom::CodeNamespace ^ proxyCode);
public WebReference(System.Web.Services.Discovery.DiscoveryClientDocumentCollection documents, System.CodeDom.CodeNamespace proxyCode);
new System.Web.Services.Description.WebReference : System.Web.Services.Discovery.DiscoveryClientDocumentCollection * System.CodeDom.CodeNamespace -> System.Web.Services.Description.WebReference
Public Sub New (documents As DiscoveryClientDocumentCollection, proxyCode As CodeNamespace)

Parameters

documents
DiscoveryClientDocumentCollection

Een DiscoveryClientDocumentCollection met een verzameling beschrijvingsdocumenten.

proxyCode
CodeNamespace

Een CodeNamespace die een naamruimte opgeeft voor codecompilatie.

Voorbeelden

Het volgende codevoorbeeld illustreert het gebruik van deze constructor. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de WebReference klasse.

// Create a web referernce using the WSDL collection.
WebReference reference = new WebReference(wsdlCollection, space);
reference.ProtocolName = "Soap12";

Opmerkingen

De documents verzameling mag alleen ServiceDescription objecten bevatten en XmlSchema objecten. De GenerateWebReferences methode kan objecten niet interpreteren DiscoveryDocument .

Van toepassing op

WebReference(DiscoveryClientDocumentCollection, CodeNamespace, String, String)

Initialiseert een nieuw exemplaar van de WebReference klasse met de opgegeven gegevens.

public:
 WebReference(System::Web::Services::Discovery::DiscoveryClientDocumentCollection ^ documents, System::CodeDom::CodeNamespace ^ proxyCode, System::String ^ appSettingUrlKey, System::String ^ appSettingBaseUrl);
public WebReference(System.Web.Services.Discovery.DiscoveryClientDocumentCollection documents, System.CodeDom.CodeNamespace proxyCode, string appSettingUrlKey, string appSettingBaseUrl);
new System.Web.Services.Description.WebReference : System.Web.Services.Discovery.DiscoveryClientDocumentCollection * System.CodeDom.CodeNamespace * string * string -> System.Web.Services.Description.WebReference
Public Sub New (documents As DiscoveryClientDocumentCollection, proxyCode As CodeNamespace, appSettingUrlKey As String, appSettingBaseUrl As String)

Parameters

documents
DiscoveryClientDocumentCollection

Een DiscoveryClientDocumentCollection met een verzameling beschrijvingsdocumenten.

proxyCode
CodeNamespace

Een CodeNamespace die een naamruimte opgeeft voor codecompilatie.

appSettingUrlKey
String

De URL-sleutel van de webreferentie.

appSettingBaseUrl
String

De basis-URL van de webreferentie.

Opmerkingen

De documents verzameling mag alleen ServiceDescription objecten bevatten en XmlSchema objecten. De GenerateWebReferences methode kan objecten niet interpreteren DiscoveryDocument .

Van toepassing op

WebReference(DiscoveryClientDocumentCollection, CodeNamespace, String, String, String)

Initialiseert een nieuw exemplaar van de WebReference klasse met de opgegeven gegevens.

public:
 WebReference(System::Web::Services::Discovery::DiscoveryClientDocumentCollection ^ documents, System::CodeDom::CodeNamespace ^ proxyCode, System::String ^ protocolName, System::String ^ appSettingUrlKey, System::String ^ appSettingBaseUrl);
public WebReference(System.Web.Services.Discovery.DiscoveryClientDocumentCollection documents, System.CodeDom.CodeNamespace proxyCode, string protocolName, string appSettingUrlKey, string appSettingBaseUrl);
new System.Web.Services.Description.WebReference : System.Web.Services.Discovery.DiscoveryClientDocumentCollection * System.CodeDom.CodeNamespace * string * string * string -> System.Web.Services.Description.WebReference
Public Sub New (documents As DiscoveryClientDocumentCollection, proxyCode As CodeNamespace, protocolName As String, appSettingUrlKey As String, appSettingBaseUrl As String)

Parameters

documents
DiscoveryClientDocumentCollection

Een DiscoveryClientDocumentCollection met een verzameling beschrijvingsdocumenten.

proxyCode
CodeNamespace

Een CodeNamespace die een naamruimte opgeeft voor codecompilatie.

protocolName
String

Het protocol dat wordt gebruikt door de XML-webservice.

appSettingUrlKey
String

De URL-sleutel van de webreferentie.

appSettingBaseUrl
String

De basis-URL van de webreferentie.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u deze constructor gebruikt.

// Read in a WSDL service description.
string url = "http://www.contoso.com/Example/WebService.asmx?WSDL";
XmlTextReader reader = new XmlTextReader(url);
ServiceDescription wsdl = ServiceDescription.Read(reader);

// Create a WSDL collection.
DiscoveryClientDocumentCollection wsdlCollection = 
    new DiscoveryClientDocumentCollection();
wsdlCollection.Add(url, wsdl);

// Create a namespace.
CodeNamespace proxyNamespace = new CodeNamespace("ExampleNamespace");

// Create a web reference using the WSDL collection.
string baseUrl = "http://www.contoso.com";
string urlKey = "ExampleUrlKey";
string protocolName = "Soap12";
WebReference reference = new WebReference(
    wsdlCollection, proxyNamespace, protocolName, urlKey, baseUrl);

// Print some information about the web reference.
Console.WriteLine("The WebReference object contains {0} document(s).", 
    reference.Documents.Count);
Console.WriteLine("The protocol name is {0}.", reference.ProtocolName);
Console.WriteLine("The base URL is {0}.", reference.AppSettingBaseUrl);
Console.WriteLine("The URL key is {0}.", reference.AppSettingUrlKey);

// Print some information about the proxy code namespace.
Console.WriteLine("The proxy code namespace is {0}.", 
    reference.ProxyCode.Name);

// Print some information about the validation warnings.
Console.WriteLine("There are {0} validation warnings.",
    reference.ValidationWarnings.Count);

// Print some information about the warnings.
if (reference.Warnings == 0)
{
    Console.WriteLine("There are no warnings.");
}
else
{
    Console.WriteLine("Warnings: " + reference.Warnings);
}

Opmerkingen

De documents verzameling mag alleen ServiceDescription objecten bevatten en XmlSchema objecten. De GenerateWebReferences methode kan objecten niet interpreteren DiscoveryDocument .

Van toepassing op