WCF Help Page - How to Disable or Change the Display URL

I looked for similar questions about SO and Google, but it seems that when viewing the * .svc file, I cannot hide or disable the standard WCF "You created the service" man page.

The problem 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, the server name is displayed here, as well as the domain name of our company. He chooses this, even if you are viewing the service using IP or localhost.

This is an external service, and we do not want these details to be available outside of orginization. I tried to tinker with setting <dns value=localhost"> , but it doesn’t look like what is shown on this Help page (to hackers).

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

+6
source share
1 answer

To completely disable the page: on web.config, define the behavior of <serviceDebug/> inside <serviceBehavior> , and the http[s]HelpPageEnabled 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> 
+14
source

Source: https://habr.com/ru/post/899794/