【发布时间】:2014-03-20 15:03:40
【问题描述】:
我有一个运行非常顺利的 WCF Rest 服务。我刚刚获得了我的 SSL 证书并将其安装在 IIS 中,添加了一个自动重定向到 https(基本上是强制 https)。现在,如果我转到“website/ServiceDirectory/Service.svc”,我仍然会收到“您已创建服务”消息,但是当我尝试实际调用该服务时,我得到 404 未找到。我已经看过通过大量文章。我禁用了 http/启用的 https。我确保我在绑定中启用了“传输”安全性..不确定我是否只是遗漏了什么或发生了什么。这是我的网络配置,但我我开始认为这可能是 IIS 中的某些东西
<system.serviceModel>
<client>
<endpoint address=""
binding="webHttpBinding" bindingConfiguration="WebBinding"
behaviorConfiguration="web"
contract="EngageService.IEngage" name="win"/>
</client>
<bindings>
<webHttpBinding>
<binding name="WebBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="ServiceBehavior" name="EngageService.Engage1">
<endpoint address="" behaviorConfiguration="web" binding="webHttpBinding"
contract="EngageService.IEngage" bindingConfiguration="WebBinding" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp defaultOutgoingResponseFormat="Xml"/>
</behavior>
</endpointBehaviors>
</behaviors>
<protocolMapping>
<!--<add binding="basicHttpBinding" scheme="http"/>-->
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
在 IIS 中,该服务被配置为一个应用程序,正如我所说,在我切换到 https 之前它运行良好。是否有人看到我的配置文件有问题,或者知道我可能需要检查/更改的任何 IIS 配置项? 谢谢
【问题讨论】:
-
在 IIS7 => features view => SSL Settings,如果在 web.config 中添加要求,可以关闭 Require SSL 选项
-
不知道我解释的是否正确。如果有人能目睹这种行为可能会更好。如果你去aaronsfriedman.com/Engage/Engage1.svc,你会看到服务信息。如果你去aaronsfriedman.com/Engage/Engage1.svc/getquote,你会得到一个愚蠢的随机报价(用于测试)。如果您随后使用 https 执行相同的步骤,您仍会看到该服务,但在尝试运行该功能时会收到“未找到”错误。