测试表仅适用于本地计算机的请求

时间:2012-11-05 15:07:36

标签: c# web-services .net-3.5 asmx

为什么对于我的某些网络服务,我会获得测试表单,以便我可以看到生成的xml数据,但对于其他网络服务,我收到一条消息The test form is only available for requests from the local machine.

两次,我都是从客户端浏览器连接到Web服务的URL,所有Web服务都是用C#,.NET-3.5创建的。

1 个答案:

答案 0 :(得分:13)

我用Google搜索"The test form is only available for requests from the local machine."

有很多结果,并且一致意见是将这些节点添加到Web服务的web.config中。我还没有尝试过这个解决方案,但您可以检查一下远程显示测试表单的Web服务是否具有在web.config中包含这些节点的Web服务。或者,您可以将其添加到提供此消息的Web服务中,并查看测试表单是否开始远程显示。

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

以下是一些搜索结果