保护.NET Web服务URL [英] Protect .net Web Service URL

查看:112
本文介绍了保护.NET Web服务URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用Asp.net 3.5创建的Web服务。现在,它的工作完美的实时Windows服务器,并给了我完美的XML在调用它使用一些URL如:

I have created Web Service using Asp.net 3.5. Now it's working perfectly in live windows server, and giving me perfect xml while invoking it using some url like :

http://www.somedomain.com/Service.asmx?op=fetchData

现在我的问题是,当我访问的网址,如:

Now My question is when I am accessing url like :

http://www.somedomain.com/Service.asmx

它的上市我创建的Web服务。

it's listing my created web services.

如果我不想列表中上下可用的Web服务提供给最终用户。

What if I don't wanna list down the available web services to end users.

在此先感谢...

推荐答案

如果您只想禁用该服务帮助页面,然后添加以下web.config文件的system.web节:

If you just want to disable the service help page then add the following to the system.web section of web.config:

<webServices>
   <wsdlHelpGenerator href="HideServices.aspx"/>
</webServices>

在这里HideServices.aspx是包含要显示,当有人试图浏览 HTTP内容的页面: //www.somedomain.com/Service.asmx (也可能是空的或通用的消息)。

where HideServices.aspx is a page that contains the content you want to display when someone tries to browse http://www.somedomain.com/Service.asmx (it could be blank or a generic message).

以上的配置并留下生成WSDL通过启用?WSDL(http://www.somedomain.com/Service.asmx?WSDL)。如果您还不想成为你的WSDL,然后,而不是添加以下的web.config的system.web节:

The above config does leave WSDL generation enabled via ?WSDL (http://www.somedomain.com/Service.asmx?WSDL). If you also don't want to serve up your WSDL then instead add the following to the system.web section of web.config:

<webServices>
  <protocols>
    <remove name="Documentation" />
  </protocols>
</webServices>

这篇关于保护.NET Web服务URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆