Recently, because the task needs to develop a webservice, after deploying to the server, the above problems, the network to find the following solution:
Cause of the problem:
A new protocol named Httppostlocalhost has been defined from the NET Framework 1.1. By default, this new protocol is enabled. The protocol allows the service to be invoked from an application that resides on the same computer as the WEB service that uses the HTTP POST request. The allowed prerequisites are: The POST URL uses http://localhostinstead of http://hostname. This enables Web service developers to invoke the Web service from the same computer as the Web service, using an HTML-based test form.
However, when you try to access the WEB service from a remote computer, the Invoke button is not displayed. Also, you receive the following error message:
The Test form is a available for requests from the local machine.
Workaround:
1. You can enable HTTP GET and HTTP POST by editing the Web. config file for the vroot in which it resides. The following configuration enables both HTTP GET and HTTP POST:
<Configuration> <system.web> <webservices> <Protocols> <Addname= "HttpGet"/> <Addname= "HttpPost"/> </Protocols> </webservices> </system.web> </Configuration>
2. Enable these protocols for all WEB services on your computer by editing the <protocols> section in Machine.config. The following example enables HTTP GET, HTTP POST, and SOAP, and also enables HTTP post from the local host:
<Protocols> <Addname= "HttpSoap"/> <Addname= "HttpPost"/> <Addname= "HttpGet"/> <Addname= "Httppostlocalhost"/> <!--documentation enables the Documentation/test pages - <Addname= "Documentation"/></Protocols>
After the WebService deployment to the server, the "Test form is only available for requests from the local machine" appears