I have just written about the service. The above problems will occur after deployment. I think many people may encounter similar problems. Let's solve them together! Cause:
NET Framework 1.1 defines
HttpPostLocalhost. By default, this new protocol is enabled. This protocol allows applications on the same computer as the Web service that uses the http post request to call this service. The precondition is that the post url is used.
Http: // localhostInstead
Http: // hostname. This allows Web service developers to use HTML-based test forms to call the Web service from the same computer where the Web Service is located.
When you try to access the Web service from a remote computer, the "call" button is not displayed. In addition, you will receive the following error message:
The test form is only available for requests from the local machine
Solution:
1. You can enable http get and http post by editing the Web. config file of the vroot where the Web Service is located. The following configurations enable both http get and http post:
<Configuration>
<System. web>
<WebServices>
<Protocols>
<Add name = "HttpGet"/>
<Add name = "HttpPost"/>
</Protocols>
</WebServices>
</System. web>
</Configuration>
2. Edit the <protocols> section in Machine. config to enable these protocols for all Web services on the computer. In the following example, http get, http post, and SOAP are enabled, and http post is also enabled from the local host:<protocols><add name="HttpSoap"/><add name="HttpPost"/><add name="HttpGet"/><add name="HttpPostLocalhost"/><!-- Documentation enables the documentation/test pages --><add name="Documentation"/></protocols>