码迷,mamicode.com
首页 > Windows程序 > 详细

WinServer 之 发布WebService后调用出现" The test form is only available for requests from the local machine. "

时间:2015-09-11 22:15:06      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:

  当您尝试从远程计算机访问 Web 服务时,不会显示“调用”按钮。并且,您会收到以下错误信息:

  The test form is only available for requests from the local machine


  解决方法:
  1.通过编辑 Web 服务所在的 vroot 的 Web.config 文件,可以启用 HTTP GET 和 HTTP POST。以下配置同时启用了 HTTP GET 和 HTTP POST:

<configuration>
    <system.web>
    <webServices>
        <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
        </protocols>
    </webServices>
    </system.web>
</configuration>


  2.通过编辑 Machine.config 中的 <protocols> 节为计算机上的所有 Web 服务启用这些协议。下面的示例启用了 HTTP GET、HTTP POST 及 SOAP,此外还从本地主机启用了 HTTP POST:

<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="HttpPostLocalhost"/>
<!-- Documentation enables the documentation/test pages -->
<add name="Documentation"/>
</protocols>

 

WinServer 之 发布WebService后调用出现" The test form is only available for requests from the local machine. "

标签:

原文地址:http://www.cnblogs.com/xinaixia/p/4802160.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!