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
WCF帮助页-如何禁用或更改显示的URL_Wcf - Fatal编程技术网

WCF帮助页-如何禁用或更改显示的URL

WCF帮助页-如何禁用或更改显示的URL,wcf,Wcf,我在SO和Google上搜索过类似的问题,但在浏览*.svc文件时,似乎无法隐藏或禁用标准WCF帮助页面“You have created a service” 我们的问题是,它在一行中显示了我们的服务器名和域名,其中显示: “要测试此服务,您需要…” 如您所见,这里显示了服务器的名称以及我们公司的域名。即使您使用IP或本地主机浏览服务,它也会检测到这一点 这是一项面向外部的服务,我们不希望在组织之外提供这些细节。我试图摆弄以完全禁用页面:在web.config上,将属性设置为false,在中定

我在SO和Google上搜索过类似的问题,但在浏览*.svc文件时,似乎无法隐藏或禁用标准WCF帮助页面“You have created a service”

我们的问题是,它在一行中显示了我们的服务器名和域名,其中显示:

“要测试此服务,您需要…”

如您所见,这里显示了服务器的名称以及我们公司的域名。即使您使用IP或本地主机浏览服务,它也会检测到这一点


这是一项面向外部的服务,我们不希望在组织之外提供这些细节。我试图摆弄
以完全禁用页面:在web.config上,将
属性设置为false,在
中定义
行为

  <system.serviceModel>
    <services>
      <service name="MyNamespace.MyService" behaviorConfiguration="NoHelpPageBehavior">
        <endpoint address="" binding="basicHttpBinding" contract="MyNamespace.IMyContract" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="NoHelpPageBehavior">
          <serviceDebug httpHelpPageEnabled="false" httpsHelpPageEnabled="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

如果答案对你有帮助,你应该接受。
  <system.serviceModel>
    <services>
      <service name="MyNamespace.MyService" behaviorConfiguration="NoHelpPageBehavior">
        <endpoint address="" binding="basicHttpBinding" contract="MyNamespace.IMyContract" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="NoHelpPageBehavior">
          <serviceDebug httpHelpPageEnabled="false" httpsHelpPageEnabled="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>