尽管我付出了所有努力,但我还是无法将我的简单 WCF 服务托管在带有 SSL 的 IIS 上。
我们正在使用带有 IIS 6.0 的 windows server 2k3,并且我们在服务器上安装了高达 .NET 4.0(网站配置为 4.0)
如果我转到 http//.../rptService.svc url,我会得到带有代码块和 ?wsdl url 的 .svc 页面
另一方面,如果我转到 https//.../rptService.svc,我会收到“找不到资源”404 错误。(网址上的冒号已删除,以防止垃圾邮件)
该网站为其启用了有效的 SSL 证书。
我的相关 web.config 文件如下:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="rptBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="wcfApp.rptServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpsGetEnabled="false" httpGetEnabled="true" />
<serviceTimeouts/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="wcfApp.rptServiceBehavior"
name="wcfApp.rptService">
<endpoint binding="wsHttpBinding" bindingConfiguration="rptBinding" contract="wcfApp.rptService"
address="">
</endpoint>
<endpoint name="MetadataBinding" address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
我已经尝试了大约 100 种不同的方法来从 150 个具有类似情况的不同博客/网络帖子中编写 web.config 文件,但到目前为止还没有任何工作。
我的最终目标是让这个 wcf 服务托管接受带有自定义用户名验证器的用户名/密码令牌,但现在我什至无法让它与 SSL 一起使用!
应用程序正在 VS 2010 中构建。
如果我可以提供更多信息,请告诉我。
任何帮助表示赞赏!