解决webseverice 发布后别人无法访问的问题

来源:互联网 发布:魔兽数据库7.0 编辑:程序博客网 时间:2024/05/20 19:30

已经写好的webseverice如果在本机上运行和调试是可以正常访问的,但是如果发布后不稍作配置别人是无法正常使用你提供的接口会提示“测试窗体只能用于来自本地计算机的请求”或者"The test form is only available for requests from the local machine. ",那是因为没有开启远程访问的原因。

 修改web.config 

<system.web></system.web>

加入

<webServices>
         <protocols>
            <add name="HttpSoap"/>
            <add name="HttpPost"/>
            <add name="HttpGet"/>
            <add name="Documentation"/>
         </protocols>
</webServices>