public override BaseUriWithWildcard GetBaseUri(string transportScheme, Uri listenUri)
        {
            BaseUriWithWildcard wildcard = null;
            HostedTransportConfigurationBase configuration = HostedTransportConfigurationManager.GetConfiguration(transportScheme) as HostedTransportConfigurationBase;

            if (configuration != null)
            {
                wildcard = configuration.FindBaseAddress(listenUri);
                if (wildcard == null)
                {
                    throw FxTrace.Exception.AsError(new InvalidOperationException(System.ServiceModel.Activation.SR.Hosting_TransportBindingNotFound(listenUri.ToString())));
                }
            }
            return(wildcard);
        }
예제 #2
0
        public override BaseUriWithWildcard GetBaseUri(string transportScheme, Uri listenUri)
        {
            BaseUriWithWildcard baseAddress = null;
            HostedTransportConfigurationBase hostedConfiguration =
                HostedTransportConfigurationManager.GetConfiguration(transportScheme) as HostedTransportConfigurationBase;

            if (hostedConfiguration != null)
            {
                baseAddress = hostedConfiguration.FindBaseAddress(listenUri);
                if (baseAddress == null)
                {
                    throw FxTrace.Exception.AsError(new InvalidOperationException(SR.Hosting_TransportBindingNotFound(listenUri.ToString())));
                }
            }
            return(baseAddress);
        }