IIS 托管 WCF 服务不接受 https 端点,收到 404 资源错误

发布于 2024-10-01 15:57:29 字数 1770 浏览 3 评论 0原文

尽管我付出了所有努力,我仍然无法使用 SSL 将简单的 WCF 服务托管在 IIS 上。

我们正在使用带有 IIS 6.0 的 Windows Server 2k3,并且我们在服务器上安装了 .NET 4.0(网站配置为 4.0)

如果我转到 http//.../rptService.svc url,我会得到 .svc 带有代码块和 ?wsdl url 的页面

另一方面, ,如果我转到 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 中构建。

如果我可以提供更多信息,请告诉我。

任何帮助表示赞赏!

Despite all of my efforts, I have not been able to get my simple WCF service hosted on IIS with SSL.

We are using windows server 2k3 with IIS 6.0 and we have up to .NET 4.0 installed on the server (web site is configured for 4.0)

If i go to http//.../rptService.svc url, I get the .svc page with the code blocks and ?wsdl url

on the other hand, if i go to https//.../rptService.svc I get a "Resource not found" 404 error. (colons on urls are removed b/c of spam prevention)

The web site has a working SSL certificate enabled for it.

My relevant web.config file is as follows:

    <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>

I have tried just about 100 different ways to write the web.config file from 150 different blog/web posts with similar situations, and have not gotten anything to work thus far.

My end goal is to get this wcf service hosted accepting a username/password token with a custom user name validator, but right now I can't even get it working with SSL!

Application is being built in VS 2010.

Please let me know if there is any more information that I can provide.

Any help is appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文