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