WCF help page - how to disable or change the displayed URL

后端 未结 1 1541
感动是毒
感动是毒 2020-12-17 00:31

I\'ve searched for similar questions on SO and Google, but seems like it\'s not possible to hide or disable the standard WCF help page \"You have created a service\" when yo

相关标签:
1条回答
  • 2020-12-17 01:05

    To disable the page completely: on web.config, define the <serviceDebug/> behavior inside a <serviceBehavior> with the http[s]HelpPageEnabled properties set to 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>
    
    0 讨论(0)
提交回复
热议问题