为RESTful WCF配置SSL绑定。 怎么样?

我当前的配置如下:

           

当我为我的网站配置了http https绑定时,这种方法有效。

我通过https连接到服务,一切都很好。

现在我想完全删除IIS上的http绑定。 我开始得到这样的错误:

找不到与绑定WebHttpBinding的端点的方案http匹配的基址。 注册的基地址方案是[https]。

[InvalidOperationException:找不到与绑定WebHttpBinding的端点的scheme http匹配的基址。 注册的基地址方案是[https]。]
System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri,Binding binding,UriSchemeKeyedCollection baseAddresses)+16582113
System.ServiceModel.Description.ConfigLoader.ConfigureEndpointAddress(ServiceEndpointElement serviceEndpointElement,ServiceHostBase host,ServiceEndpoint endpoint)+117
System.ServiceModel.Description.ConfigLoader.ConfigureEndpoint(StandardEndpointElement standardEndpointElement,ServiceEndpointElement serviceEndpointElement,ContextInformation context,ServiceHostBase host,ServiceDescription description,ServiceEndpoint&endpoint,Boolean omitSettingEndpointAddress)+937
System.ServiceModel.Description.ConfigLoader.LookupEndpoint(ServiceEndpointElement serviceEndpointElement,ContextInformation context,ServiceHostBase host,ServiceDescription description,Boolean omitSettingEndpointAddress)+8728167
System.ServiceModel.Web.WebServiceHost.AddAutomaticWebHttpBindingEndpoints(ServiceHost host,IDictionary`2 implementedContracts,String multipleContractsErrorMessage,String standardEndpointKind)+982
System.ServiceModel.Web.WebServiceHost.OnOpening()+311
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)+612
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath)+255
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)+1172

[ServiceActivationException:由于编译期间发生exception,无法激活服务’/ DEMO / mobile’。 exception消息是:找不到与绑定WebHttpBinding的端点的scheme http匹配的基址。 注册的基地址方案是[https] ..] System.Runtime.AsyncResult.End(IAsyncResult result)+901424
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)+178702
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)+136

我为WCF找到了大量样本,但是REST WCF在配置方面看起来不同,我想知道为什么它会重要。 从我的配置的外观 – 它根本不应该在SSL上工作,但它在https绑定存在时确实有效..

做错误说的…修复你的绑定

                

接受的答案对我不起作用,因为我需要保留我的标准端点元素。 我能够删除我的http绑定,只通过在我的Web.config中添加部分,在IIS中保留https绑定

确保不在上设置name属性,否则这将不起作用

我的Web.config的相关部分:

                  

试试这个