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


C# ServiceHostBase.GetVia方法代码示例

本文整理汇总了C#中ServiceHostBase.GetVia方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceHostBase.GetVia方法的具体用法?C# ServiceHostBase.GetVia怎么用?C# ServiceHostBase.GetVia使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ServiceHostBase的用法示例。


在下文中一共展示了ServiceHostBase.GetVia方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetExtensionProperties

 private void SetExtensionProperties(ServiceMetadataExtension mex, ServiceHostBase host)
 {
     mex.HttpHelpPageEnabled = this.httpHelpPageEnabled;
     mex.HttpHelpPageUrl = host.GetVia(Uri.UriSchemeHttp, (this.httpHelpPageUrl == null) ? new Uri(string.Empty, UriKind.Relative) : this.httpHelpPageUrl);
     mex.HttpHelpPageBinding = this.HttpHelpPageBinding;
     mex.HttpsHelpPageEnabled = this.httpsHelpPageEnabled;
     mex.HttpsHelpPageUrl = host.GetVia(Uri.UriSchemeHttps, (this.httpsHelpPageUrl == null) ? new Uri(string.Empty, UriKind.Relative) : this.httpsHelpPageUrl);
     mex.HttpsHelpPageBinding = this.HttpsHelpPageBinding;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ServiceDebugBehavior.cs

示例2: EnsureHelpPageDispatcher

 private bool EnsureHelpPageDispatcher(ServiceHostBase host, ServiceMetadataExtension mex, Uri url, string scheme)
 {
     Uri via = host.GetVia(scheme, (url == null) ? new Uri(string.Empty, UriKind.Relative) : url);
     if (via == null)
     {
         return false;
     }
     ((ServiceMetadataExtension.HttpGetImpl) mex.EnsureGetDispatcher(via, 1).Endpoints[0].DispatchRuntime.SingletonInstanceContext.UserObject).HelpPageEnabled = true;
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:ServiceDebugBehavior.cs

示例3: EnsureListenUri

 static Uri EnsureListenUri(ServiceHostBase serviceHost, ServiceEndpoint endpoint)
 {
     Uri listenUri = endpoint.ListenUri;
     if (listenUri == null)
     {
         listenUri = serviceHost.GetVia(endpoint.Binding.Scheme, ServiceHost.EmptyUri);
     }
     if (listenUri == null)
     {
         AspNetEnvironment.Current.ProcessNotMatchedEndpointAddress(listenUri, endpoint.Binding.Name);
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxEndpointNoMatchingScheme, endpoint.Binding.Scheme, endpoint.Binding.Name, serviceHost.GetBaseAddressSchemes())));
     }
     return listenUri;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:14,代码来源:DispatcherBuilder.cs

示例4: EnsureHelpPageDispatcher

        bool EnsureHelpPageDispatcher(ServiceHostBase host, ServiceMetadataExtension mex, Uri url, string scheme)
        {
            Uri address = host.GetVia(scheme, url == null ? new Uri(string.Empty, UriKind.Relative) : url);

            if (address == null)
            {
                return false;
            }

            ChannelDispatcher channelDispatcher = mex.EnsureGetDispatcher(address, true /* isServiceDebugBehavior */);
            ((ServiceMetadataExtension.HttpGetImpl)channelDispatcher.Endpoints[0].DispatchRuntime.SingletonInstanceContext.UserObject).HelpPageEnabled = true;

            return true;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:14,代码来源:ServiceDebugBehavior.cs

示例5: SetExtensionProperties

        void SetExtensionProperties(ServiceDescription description, ServiceHostBase host, ServiceMetadataExtension mex)
        {
            mex.ExternalMetadataLocation = this.ExternalMetadataLocation;
            mex.Initializer = new MetadataExtensionInitializer(this, description, host);
            mex.HttpGetEnabled = this.httpGetEnabled;
            mex.HttpsGetEnabled = this.httpsGetEnabled;

            mex.HttpGetUrl = host.GetVia(Uri.UriSchemeHttp, this.httpGetUrl == null ? new Uri(string.Empty, UriKind.Relative) : this.httpGetUrl);
            mex.HttpsGetUrl = host.GetVia(Uri.UriSchemeHttps, this.httpsGetUrl == null ? new Uri(string.Empty, UriKind.Relative) : this.httpsGetUrl);

            mex.HttpGetBinding = this.httpGetBinding;
            mex.HttpsGetBinding = this.httpsGetBinding;

            UseRequestHeadersForMetadataAddressBehavior dynamicUpdateBehavior = description.Behaviors.Find<UseRequestHeadersForMetadataAddressBehavior>();
            if (dynamicUpdateBehavior != null)
            {
                mex.UpdateAddressDynamically = true;
                mex.UpdatePortsByScheme = new Dictionary<string, int>(dynamicUpdateBehavior.DefaultPortsByScheme);
            }

            foreach (ChannelDispatcherBase dispatcherBase in host.ChannelDispatchers)
            {
                ChannelDispatcher dispatcher = dispatcherBase as ChannelDispatcher;
                if (dispatcher != null && IsMetadataTransferDispatcher(description, dispatcher))
                {
                    mex.MexEnabled = true;
                    mex.MexUrl = dispatcher.Listener.Uri;
                    if (dynamicUpdateBehavior != null)
                    {
                        foreach (EndpointDispatcher endpointDispatcher in dispatcher.Endpoints)
                        {
                            if (!endpointDispatcher.AddressFilterSetExplicit)
                            {
                                endpointDispatcher.AddressFilter = new MatchAllMessageFilter();
                            }
                        }
                    }
                    break;
                }
            }

        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:42,代码来源:ServiceMetadataBehavior.cs

示例6: EnsureGetDispatcher

 private static void EnsureGetDispatcher(ServiceHostBase host, ServiceMetadataExtension mex, Uri url, string scheme)
 {
     Uri via = host.GetVia(scheme, (url == null) ? new Uri(string.Empty, UriKind.Relative) : url);
     if (via == null)
     {
         if (scheme == Uri.UriSchemeHttp)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxServiceMetadataBehaviorNoHttpBaseAddress")));
         }
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxServiceMetadataBehaviorNoHttpsBaseAddress")));
     }
     ((ServiceMetadataExtension.HttpGetImpl) mex.EnsureGetDispatcher(via, 0).Endpoints[0].DispatchRuntime.SingletonInstanceContext.UserObject).GetWsdlEnabled = true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:ServiceMetadataBehavior.cs


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