WebReference 생성자

정의

WebReference 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
WebReference(DiscoveryClientDocumentCollection, CodeNamespace)

지정된 설명 문서 컬렉션 및 프록시 코드 네임스페이 WebReference 스를 사용하여 클래스의 새 인스턴스를 초기화합니다.

WebReference(DiscoveryClientDocumentCollection, CodeNamespace, String, String)

지정된 데이터를 사용하여 클래스의 WebReference 새 인스턴스를 초기화합니다.

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

지정된 데이터를 사용하여 클래스의 WebReference 새 인스턴스를 초기화합니다.

WebReference(DiscoveryClientDocumentCollection, CodeNamespace)

지정된 설명 문서 컬렉션 및 프록시 코드 네임스페이 WebReference 스를 사용하여 클래스의 새 인스턴스를 초기화합니다.

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)

매개 변수

documents
DiscoveryClientDocumentCollection

설명 문서의 컬렉션을 지정하는 A DiscoveryClientDocumentCollection 입니다.

proxyCode
CodeNamespace

코드 컴파일을 위한 네임스페이스를 지정하는 A CodeNamespace 입니다.

예제

다음 코드 예제에서는이 생성자의 사용을 보여 줍니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 WebReference 일부입니다.

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

설명

컬렉션에는 documents 개체만 ServiceDescription 포함되어야 합니다 XmlSchema . 메서드는 개체를 GenerateWebReferences 해석 DiscoveryDocument 할 수 없습니다.

적용 대상

WebReference(DiscoveryClientDocumentCollection, CodeNamespace, String, String)

지정된 데이터를 사용하여 클래스의 WebReference 새 인스턴스를 초기화합니다.

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)

매개 변수

documents
DiscoveryClientDocumentCollection

설명 문서의 컬렉션을 지정하는 A DiscoveryClientDocumentCollection 입니다.

proxyCode
CodeNamespace

코드 컴파일을 위한 네임스페이스를 지정하는 A CodeNamespace 입니다.

appSettingUrlKey
String

웹 참조의 URL 키입니다.

appSettingBaseUrl
String

웹 참조의 기본 URL입니다.

설명

컬렉션에는 documents 개체만 ServiceDescription 포함되어야 합니다 XmlSchema . 메서드는 개체를 GenerateWebReferences 해석 DiscoveryDocument 할 수 없습니다.

적용 대상

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

지정된 데이터를 사용하여 클래스의 WebReference 새 인스턴스를 초기화합니다.

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)

매개 변수

documents
DiscoveryClientDocumentCollection

설명 문서의 컬렉션을 지정하는 A DiscoveryClientDocumentCollection 입니다.

proxyCode
CodeNamespace

코드 컴파일을 위한 네임스페이스를 지정하는 A CodeNamespace 입니다.

protocolName
String

XML 웹 서비스에서 사용하는 프로토콜입니다.

appSettingUrlKey
String

웹 참조의 URL 키입니다.

appSettingBaseUrl
String

웹 참조의 기본 URL입니다.

예제

다음 코드 예제에서는이 생성자를 사용 하는 방법을 보여 있습니다.

// 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);
}

설명

컬렉션에는 documents 개체만 ServiceDescription 포함되어야 합니다 XmlSchema . 메서드는 개체를 GenerateWebReferences 해석 DiscoveryDocument 할 수 없습니다.

적용 대상