wcf - 在互联网上发布的wcf服务有 'You have created a service'页面是不是很糟糕?

标签 wcf wcf-security

我已经创建了 wcf 服务并计划使其可通过互联网访问。 “您已创建服务”页面似乎是一些 stub ,应该在将服务投入生产之前替换。在生产环境中使用此欢迎页面是一种不好的做法吗?当您在 Internet 上发布 WCF 服务时,您如何处理该欢迎页面?

谢谢

最佳答案

在生产中,您可以通过添加以下内容来关闭此页面:

<behaviors>
  <serviceBehaviors>
    <behavior name="ProductionService">
      <serviceDebug includeExceptionsInDetail="false" httpHelpPageEnabled="false" />
    </behavior>
  <serviceBehaviors>
</behavirs>

还要考虑发布 WSDL/元数据。如果您不想发布 WSDL 但想使用 mex 端点,请使用以下配置:

<behaviors>
  <serviceBehaviors>
    <behavior name="ProductionService">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionsInDetail="false" httpHelpPageEnabled="false" />
    </behavior>
  <serviceBehaviors>
</behavirs>

您的服务必须在其行为配置属性中使用这些行为。

关于wcf - 在互联网上发布的wcf服务有 'You have created a service'页面是不是很糟糕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3582232/

相关文章:

c# - 带有客户端证书的 WCF 应用程序在一段时间后失败?

c# - 异步 WCF 服务和调用持续时间性能计数器

c# - 使用 WCF 的 REST 服务 - 可选的查询字符串参数?

c# - WCF 错误 : 'It is likely that certificate ' my cert' may not have a private key that is capable of key exchange

wcf - 将 WCF 时钟偏差增加到一个多小时的实际安全后果

c# - 如何从客户端请求中获取 X509Certificate

c# - 无法建立连接,因为目标机器主动拒绝 127.0.0.1 :3446

c# - 在 IIS 6 中托管 .net 4.0 REST WCF 服务

security - 传输级与消息级安全

wcf - 如何在 WCF 4.0 REST 服务上启用基本身份验证?