After the WebService deployment to the server, the "Test form is only available for requests from the local machine" appears

Source: Internet
Author: User
Tags http post

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.