本文整理汇总了C#中System.Web.Services.Discovery.DiscoveryClientProtocol.Discover方法的典型用法代码示例。如果您正苦于以下问题:C# DiscoveryClientProtocol.Discover方法的具体用法?C# DiscoveryClientProtocol.Discover怎么用?C# DiscoveryClientProtocol.Discover使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Services.Discovery.DiscoveryClientProtocol
的用法示例。
在下文中一共展示了DiscoveryClientProtocol.Discover方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Discover
/// <include file='doc\SoapClientProtocol.uex' path='docs/doc[@for="SoapHttpClientProtocol.Discover"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public void Discover() {
if (clientType.Binding == null)
throw new InvalidOperationException(Res.GetString(Res.DiscoveryIsNotPossibleBecauseTypeIsMissing1, this.GetType().FullName));
DiscoveryClientProtocol disco = new DiscoveryClientProtocol(this);
DiscoveryDocument doc = disco.Discover(Url);
foreach (object item in doc.References) {
System.Web.Services.Discovery.SoapBinding soapBinding = item as System.Web.Services.Discovery.SoapBinding;
if (soapBinding != null) {
if (clientType.Binding.Name == soapBinding.Binding.Name &&
clientType.Binding.Namespace == soapBinding.Binding.Namespace) {
Url = soapBinding.Address;
return;
}
}
}
throw new InvalidOperationException(Res.GetString(Res.TheBindingNamedFromNamespaceWasNotFoundIn3, clientType.Binding.Name, clientType.Binding.Namespace, Url));
}
示例2: Discover
public void Discover ()
{
BindingInfo bnd = (BindingInfo) type_info.Bindings [0];
DiscoveryClientProtocol discoverer = new DiscoveryClientProtocol ();
discoverer.Discover (Url);
foreach (object info in discoverer.AdditionalInformation)
{
System.Web.Services.Discovery.SoapBinding sb = info as System.Web.Services.Discovery.SoapBinding;
if (sb != null && sb.Binding.Name == bnd.Name && sb.Binding.Namespace == bnd.Namespace) {
Url = sb.Address;
return;
}
}
string msg = string.Format ("The binding named '{0}' from namespace '{1}' was not found in the discovery document at '{2}'", bnd.Name, bnd.Namespace, Url);
throw new Exception (msg);
}
示例3: Discover
public void Discover()
{
if (this.clientType.Binding == null)
{
throw new InvalidOperationException(System.Web.Services.Res.GetString("DiscoveryIsNotPossibleBecauseTypeIsMissing1", new object[] { base.GetType().FullName }));
}
DiscoveryClientProtocol protocol = new DiscoveryClientProtocol(this);
foreach (object obj2 in protocol.Discover(base.Url).References)
{
System.Web.Services.Discovery.SoapBinding binding = obj2 as System.Web.Services.Discovery.SoapBinding;
if (((binding != null) && (this.clientType.Binding.Name == binding.Binding.Name)) && (this.clientType.Binding.Namespace == binding.Binding.Namespace))
{
base.Url = binding.Address;
return;
}
}
throw new InvalidOperationException(System.Web.Services.Res.GetString("TheBindingNamedFromNamespaceWasNotFoundIn3", new object[] { this.clientType.Binding.Name, this.clientType.Binding.Namespace, base.Url }));
}