WCF 帮助页面 - 如何禁用或更改显示的 URL
我在 SO 和 Google 上搜索了类似的问题,但当您浏览到 *.svc 文件时,似乎无法隐藏或禁用标准 WCF 帮助页面“您已创建服务”。
我们面临的问题是,它在行中显示了我们的服务器名称和域名:
“要测试此服务,您将需要...”
svcutil.exe http://machinename.companydomain.local/CARS.Service/ServiceCARS.svc?wsdl
如您所见,这里显示了服务器的名称以及我们的域名。公司域名。即使您使用 IP 或本地主机浏览到该服务,它也会获取此信息。
这是一项面向外部的服务,我们不希望在组织外部提供这些详细信息。我试图摆弄
设置,但这似乎并没有改变这个“帮助”(黑客)页面上显示的内容。
那么有什么想法吗?如何完全禁用页面或隐藏页面中的计算机名称和域名?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要完全禁用该页面:在 web.config 上,使用
http[s]HelpPageEnabled 定义
属性设置为 false。
内的
行为To disable the page completely: on web.config, define the
<serviceDebug/>
behavior inside a<serviceBehavior>
with thehttp[s]HelpPageEnabled
properties set to false.