语言

MetadataResolver.BeginResolve 方法

定义

开始一个异步调用,该调用将元数据地址解析为该服务的对象集合 ServiceEndpoint 。

重载

名称 说明
BeginResolve(IEnumerable<ContractDescription>, EndpointAddress, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址和异步状态和委托将元数据地址解析为 ServiceEndpoint 指定协定的对象。

BeginResolve(Type, EndpointAddress, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址和异步状态和委托将元数据地址解析为 ServiceEndpoint 指定协定的对象。

BeginResolve(IEnumerable<ContractDescription>, EndpointAddress, MetadataExchangeClient, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、ServiceEndpoint异步状态和委托将元数据地址解析为MetadataExchangeClient指定协定的对象。

BeginResolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、值、ServiceEndpoint异步状态和委托将元数据地址解析为MetadataExchangeClientMode指定协定的对象。

BeginResolve(Type, Uri, MetadataExchangeClientMode, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、ServiceEndpoint异步状态和委托将元数据地址解析为MetadataExchangeClientMode指定协定的对象。

BeginResolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode, MetadataExchangeClient, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、ServiceEndpoint、MetadataExchangeClient异步状态和委托将元数据地址解析为MetadataExchangeClientMode指定协定的对象。

注解

这些方法开始方法的 Resolve 异步版本。

BeginResolve(IEnumerable<ContractDescription>, EndpointAddress, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址和异步状态和委托将元数据地址解析为 ServiceEndpoint 指定协定的对象。

public:
 static IAsyncResult ^ BeginResolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, System::ServiceModel::EndpointAddress ^ address, AsyncCallback ^ callback, System::Object ^ asyncState);
public static IAsyncResult BeginResolve(System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, System.ServiceModel.EndpointAddress address, AsyncCallback callback, object asyncState);
static member BeginResolve : seq<System.ServiceModel.Description.ContractDescription> * System.ServiceModel.EndpointAddress * AsyncCallback * obj -> IAsyncResult
Public Shared Function BeginResolve (contracts As IEnumerable(Of ContractDescription), address As EndpointAddress, callback As AsyncCallback, asyncState As Object) As IAsyncResult

参数

contracts
IEnumerable<ContractDescription>

要为其下载和解析元数据的协定。

address
EndpointAddress

元数据地址。

callback
AsyncCallback

调用完成后调用的异步回调委托。

asyncState
Object

与异步调用关联的状态。

返回

引用 IAsyncResult 异步解析操作的引用。

例外

地址、协定或回调为 null.

contracts为空,至少为一contracts个成员null,或contracts包含多个具有相同名称和命名空间的协定。

注解

上的 System.ServiceModel.Description.MetadataExchangeClient 默认设置用于检索元数据,默认值 System.ServiceModel.Description.MetadataExchangeClientMode 为 MetadataExchangeClientMode.MetadataExchange。

若要下载元数据但不将信息解析为 ServiceEndpoint 对象,请使用 System.ServiceModel.Description.MetadataExchangeClient 直接。

注释

如果未导入任何终结点,或者没有与协定匹配的终结点,则返回空集合。 如果返回空集合,则会写入警告跟踪。

适用于

BeginResolve(Type, EndpointAddress, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址和异步状态和委托将元数据地址解析为 ServiceEndpoint 指定协定的对象。

public:
 static IAsyncResult ^ BeginResolve(Type ^ contract, System::ServiceModel::EndpointAddress ^ address, AsyncCallback ^ callback, System::Object ^ asyncState);
public static IAsyncResult BeginResolve(Type contract, System.ServiceModel.EndpointAddress address, AsyncCallback callback, object asyncState);
static member BeginResolve : Type * System.ServiceModel.EndpointAddress * AsyncCallback * obj -> IAsyncResult
Public Shared Function BeginResolve (contract As Type, address As EndpointAddress, callback As AsyncCallback, asyncState As Object) As IAsyncResult

参数

contract
Type

要为其下载和解析元数据的协定。

address
EndpointAddress

元数据地址。

callback
AsyncCallback

调用完成后调用的异步回调委托。

asyncState
Object

与异步调用关联的状态。

返回

引用 IAsyncResult 异步解析操作的引用。

例外

地址、协定或回调为 null.

注解

上的 System.ServiceModel.Description.MetadataExchangeClient 默认设置用于检索元数据,默认值 System.ServiceModel.Description.MetadataExchangeClientMode 为 MetadataExchangeClientMode.MetadataExchange。

若要下载元数据但不将信息解析为 ServiceEndpoint 对象,请使用 System.ServiceModel.Description.MetadataExchangeClient 直接。

注释

如果未导入任何终结点,或者没有与协定匹配的终结点,则返回空集合。 如果返回空集合,则会写入警告跟踪。

此方法要求指定协定类型。 可以通过在客户端代码中声明服务接口或使用由 Svcutil.exe生成的 WCF 客户端来指定协定。 如果接口更改(例如添加新操作),则必须更新客户端代码中的接口或生成新的 WCF 客户端。 如果不这样做,将引发异常。 例如,你有一个实现名为 ICalculator 的服务协定的服务,该协定定义了 Add()、Sub()、Mult()和 Div()。 创建客户端应用程序并生成 WCF 客户端。 然后将一个方法添加到名为 Echo() 的 ICalculator。 然后,如果编写一个应用程序来调用 Resolve(Type, EndpointAddress) 而不生成新的 WCF 客户端,则会出现以下异常。

Unhandled Exception: System.ServiceModel.Description.WsdlImporter+WsdlImportException: Cannot locate operation Echo in Contract ICalculator。

适用于

BeginResolve(IEnumerable<ContractDescription>, EndpointAddress, MetadataExchangeClient, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、ServiceEndpoint异步状态和委托将元数据地址解析为MetadataExchangeClient指定协定的对象。

public:
 static IAsyncResult ^ BeginResolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, System::ServiceModel::EndpointAddress ^ address, System::ServiceModel::Description::MetadataExchangeClient ^ client, AsyncCallback ^ callback, System::Object ^ asyncState);
public static IAsyncResult BeginResolve(System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, System.ServiceModel.EndpointAddress address, System.ServiceModel.Description.MetadataExchangeClient client, AsyncCallback callback, object asyncState);
static member BeginResolve : seq<System.ServiceModel.Description.ContractDescription> * System.ServiceModel.EndpointAddress * System.ServiceModel.Description.MetadataExchangeClient * AsyncCallback * obj -> IAsyncResult
Public Shared Function BeginResolve (contracts As IEnumerable(Of ContractDescription), address As EndpointAddress, client As MetadataExchangeClient, callback As AsyncCallback, asyncState As Object) As IAsyncResult

参数

contracts
IEnumerable<ContractDescription>

要为其下载和解析元数据的协定。

address
EndpointAddress

元数据地址。

client
MetadataExchangeClient

MetadataExchangeClient用于检索元数据。

callback
AsyncCallback

调用完成后调用的异步回调委托。

asyncState
Object

与异步调用关联的状态。

返回

引用 IAsyncResult 异步解析操作的引用。

例外

地址、协定、客户端或回调为 null。

contracts 为空,至少一个 contracts 成员为 null,或 contracts 包含多个具有相同名称和命名空间的协定。

注解

默认 System.ServiceModel.Description.MetadataExchangeClientMode 为 MetadataExchangeClientMode.MetadataExchange。

若要下载元数据但不将信息解析为 ServiceEndpoint 对象,请使用 System.ServiceModel.Description.MetadataExchangeClient 直接。

注释

如果未导入任何终结点,或者没有与协定匹配的终结点,则返回空集合。 如果返回空集合,则会写入警告跟踪。

适用于

BeginResolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、值、ServiceEndpoint异步状态和委托将元数据地址解析为MetadataExchangeClientMode指定协定的对象。

public:
 static IAsyncResult ^ BeginResolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, Uri ^ address, System::ServiceModel::Description::MetadataExchangeClientMode mode, AsyncCallback ^ callback, System::Object ^ asyncState);
public static IAsyncResult BeginResolve(System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode, AsyncCallback callback, object asyncState);
static member BeginResolve : seq<System.ServiceModel.Description.ContractDescription> * Uri * System.ServiceModel.Description.MetadataExchangeClientMode * AsyncCallback * obj -> IAsyncResult
Public Shared Function BeginResolve (contracts As IEnumerable(Of ContractDescription), address As Uri, mode As MetadataExchangeClientMode, callback As AsyncCallback, asyncState As Object) As IAsyncResult

参数

contracts
IEnumerable<ContractDescription>

要为其下载和解析元数据的协定。

address
Uri

元数据地址。

mode
MetadataExchangeClientMode

检索模式。

callback
AsyncCallback

调用完成后调用的异步回调委托。

asyncState
Object

与异步调用关联的状态。

返回

引用 IAsyncResult 异步解析操作的引用。

例外

地址、协定或回调为 null.

contracts 为空,至少一个 contracts 成员为 null,或 contracts 包含多个具有相同名称和命名空间的协定。

注解

用于检索元数据的默认设置 System.ServiceModel.Description.MetadataExchangeClient 。

若要下载元数据但不将信息解析为 ServiceEndpoint 对象,请使用 System.ServiceModel.Description.MetadataExchangeClient 直接。

注释

如果未导入任何终结点,或者没有与协定匹配的终结点,则返回空集合。 如果返回空集合,则会写入警告跟踪。

适用于

BeginResolve(Type, Uri, MetadataExchangeClientMode, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、ServiceEndpoint异步状态和委托将元数据地址解析为MetadataExchangeClientMode指定协定的对象。

public:
 static IAsyncResult ^ BeginResolve(Type ^ contract, Uri ^ address, System::ServiceModel::Description::MetadataExchangeClientMode mode, AsyncCallback ^ callback, System::Object ^ asyncState);
public static IAsyncResult BeginResolve(Type contract, Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode, AsyncCallback callback, object asyncState);
static member BeginResolve : Type * Uri * System.ServiceModel.Description.MetadataExchangeClientMode * AsyncCallback * obj -> IAsyncResult
Public Shared Function BeginResolve (contract As Type, address As Uri, mode As MetadataExchangeClientMode, callback As AsyncCallback, asyncState As Object) As IAsyncResult

参数

contract
Type

要为其下载和解析元数据的协定。

address
Uri

元数据地址。

mode
MetadataExchangeClientMode

检索模式。

callback
AsyncCallback

调用完成后调用的异步回调委托。

asyncState
Object

与异步调用关联的状态。

返回

引用 IAsyncResult 异步解析操作的引用。

例外

地址、协定或回调为 null.

注解

用于检索元数据的默认设置 System.ServiceModel.Description.MetadataExchangeClient 。

若要下载元数据但不将信息解析为 ServiceEndpoint 对象,请使用 System.ServiceModel.Description.MetadataExchangeClient 直接。

注释

如果未导入任何终结点,或者没有与协定匹配的终结点,则返回空集合。 如果返回空集合,则会写入警告跟踪。

适用于

BeginResolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode, MetadataExchangeClient, AsyncCallback, Object)

开始一个异步调用,该调用使用指定的地址、ServiceEndpoint、MetadataExchangeClient异步状态和委托将元数据地址解析为MetadataExchangeClientMode指定协定的对象。

public:
 static IAsyncResult ^ BeginResolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, Uri ^ address, System::ServiceModel::Description::MetadataExchangeClientMode mode, System::ServiceModel::Description::MetadataExchangeClient ^ client, AsyncCallback ^ callback, System::Object ^ asyncState);
public static IAsyncResult BeginResolve(System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode, System.ServiceModel.Description.MetadataExchangeClient client, AsyncCallback callback, object asyncState);
static member BeginResolve : seq<System.ServiceModel.Description.ContractDescription> * Uri * System.ServiceModel.Description.MetadataExchangeClientMode * System.ServiceModel.Description.MetadataExchangeClient * AsyncCallback * obj -> IAsyncResult
Public Shared Function BeginResolve (contracts As IEnumerable(Of ContractDescription), address As Uri, mode As MetadataExchangeClientMode, client As MetadataExchangeClient, callback As AsyncCallback, asyncState As Object) As IAsyncResult

参数

contracts
IEnumerable<ContractDescription>

要为其下载和解析元数据的协定。

address
Uri

元数据地址。

mode
MetadataExchangeClientMode

检索模式。

client
MetadataExchangeClient

MetadataExchangeClient用于检索元数据。

callback
AsyncCallback

调用完成后调用的异步回调委托。

asyncState
Object

与异步调用关联的状态。

返回

引用 IAsyncResult 异步解析操作的引用。

例外

地址、协定或回调为 null.

contracts 为空,至少一个 contracts 成员为 null,或 contracts 包含多个具有相同名称和命名空间的协定。

注解

若要下载元数据但不将信息解析为 ServiceEndpoint 对象,请使用 System.ServiceModel.Description.MetadataExchangeClient 直接。

注释

如果未导入任何终结点,或者没有与协定匹配的终结点,则返回空集合。 如果返回空集合,则会写入警告跟踪。

适用于