Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net WCF Rest-允许SSL/TLS和非安全连接到同一主机名_.net_Wcf_Rest_Ssl - Fatal编程技术网

.net WCF Rest-允许SSL/TLS和非安全连接到同一主机名

.net WCF Rest-允许SSL/TLS和非安全连接到同一主机名,.net,wcf,rest,ssl,.net,Wcf,Rest,Ssl,我在IIS中托管了一个RESTful WCF服务。它有自己的自定义WebServiceHostFactory和WebServiceHost子类 现在,它的IIS网站配置了TLS和非TLS绑定(都到相同的IP地址)。但是,当请求进入不安全的IIS绑定时,会发生此错误(隐藏在ASP.NET YSoD中的SGML注释中): [EndpointNotFoundException]:没有正在侦听的频道'http://mywebservice.com./MyService.svc/'. 这通常是由不正确的地

我在IIS中托管了一个RESTful WCF服务。它有自己的自定义WebServiceHostFactory和WebServiceHost子类

现在,它的IIS网站配置了TLS和非TLS绑定(都到相同的IP地址)。但是,当请求进入不安全的IIS绑定时,会发生此错误(隐藏在ASP.NET YSoD中的SGML注释中):

[EndpointNotFoundException]:没有正在侦听的频道'http://mywebservice.com./MyService.svc/'. 这通常是由不正确的地址URI引起的。确保消息发送到的地址与服务正在侦听的地址匹配。 位于System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult结果) 在System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()中 [HttpException]:没有正在侦听的频道'http://mywebservice.com./MyService.svc/'. 这通常是由不正确的地址URI引起的。确保消息发送到的地址与服务正在侦听的地址匹配。 在System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult结果)处 在System.ServiceModel.Activation.HostedHttPrequesStatAsyncResult.End(IAsyncResult结果)处 在System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication上下文,布尔流上下文) 在System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()中 在System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成) 但是,我不知道在哪里设置这些绑定-因为在我的代码或web.config文件中没有任何地方告诉它使用“https://mywebservice.com/MyService.svc“首先

我注意到异常详细信息将主机名声明为“mywebservice.com”的根绝对FQDN,而不是“mywebservice.com”的典型根相对FQDN,这有什么意义吗


编辑(回应评论):IIS网站有两个绑定,一个在端口80上绑定到一个IP地址的HTTP,另一个在同一IP地址上绑定到端口443上的HTTPS。这两个绑定都没有主机头设置。

您是否在IIS管理器|[Web站点]|编辑绑定中同时配置了https和http绑定?您的
服务元数据中是否同时设置了
httpGetEnabled=“True”
httpsGetEnabled=“True”
?你能发布你的服务器端配置吗? [EndpointNotFoundException]: There was no channel actively listening at 'http://mywebservice.com./MyService.svc/'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening. at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() [HttpException]: There was no channel actively listening at 'http://mywebservice.com./MyService.svc/'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening. at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)