本文整理汇总了C#中System.Web.Services.Discovery.DiscoveryClientProtocol.ResolveOneLevel方法的典型用法代码示例。如果您正苦于以下问题:C# DiscoveryClientProtocol.ResolveOneLevel方法的具体用法?C# DiscoveryClientProtocol.ResolveOneLevel怎么用?C# DiscoveryClientProtocol.ResolveOneLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Services.Discovery.DiscoveryClientProtocol
的用法示例。
在下文中一共展示了DiscoveryClientProtocol.ResolveOneLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DiscoverWebServiceMetadata
void DiscoverWebServiceMetadata(object sender, DoWorkEventArgs e)
{
Uri url = (Uri)e.Argument;
var client = new DiscoveryClientProtocol();
client.Credentials = GetCredentials();
DiscoveryDocument document = client.DiscoverAny(url.AbsoluteUri);
client.ResolveOneLevel();
e.Result = new ServiceReferenceDiscoveryEventArgs(client.References);
}
示例2: GetServiceDescriptions
public static ServiceDescriptionCollection GetServiceDescriptions(DiscoveryClientProtocol protocol)
{
ServiceDescriptionCollection services = new ServiceDescriptionCollection();
protocol.ResolveOneLevel();
foreach (DictionaryEntry entry in protocol.References) {
ContractReference contractRef = entry.Value as ContractReference;
if (contractRef != null) {
services.Add(contractRef.Contract);
}
}
return services;
}