当前位置: 首页>>代码示例>>C#>>正文


C# DiscoveryClientProtocol.Discover方法代码示例

本文整理汇总了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));
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:21,代码来源:SoapClientProtocol.cs

示例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);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:19,代码来源:SoapHttpClientProtocol.cs

示例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 }));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:SoapHttpClientProtocol.cs


注:本文中的System.Web.Services.Discovery.DiscoveryClientProtocol.Discover方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。