Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

wcf

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 you browse to your *.svc file.

The problem for us is that it shows our server name and domain name in the line where it says:

"To test this service, you will need to..."

svcutil.exe http://machinename.companydomain.local/CARS.Service/ServiceCARS.svc?wsdl

As you can see, here it shows the server's name as well as our company domain name. It picks this up even if you browse to the service with an IP or localhost.

This is an external facing service and we do not want those details to be made available outside the orginization. I have tried to fiddle with the <dns value=localhost"> setting, but that does not seem to change what is displayed on this "help" (the hackers) page.

So any ideas? How to either disable the page completely or to hide the machine name and domain name from the page?

like image 873
Ghlouw Avatar asked Oct 21 '11 14:10

Ghlouw


1 Answers

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>
like image 171
carlosfigueira Avatar answered Sep 18 '22 18:09

carlosfigueira