16

ASP.Net Web Service: The test form is only available for requests from the local machine.

You create a very cool ASP.Net Web Service on your local machine. You are ready to show the world, you deploy it on the server. Then you get the following message "The test form is only available for requests from the local machine. " Here is what you need to fix that.

Open the web config file and add the following, you will be able to access the form outside of the localhost:

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

Click Here to Leave a Comment Below 16 comments
bespoke software - January 25, 2010

That was an inspiring post,
This is great ASP.Net Web Service advice,
Keep up the good work

Reply
RM - August 9, 2010

Thanks for the solution. It worked for me too.

Reply
Martin - September 12, 2011

Thanks!

Reply
Mark Waser - March 19, 2012

This only solved the problem for some of the functions. Any function with an XML input still has the message. All others work perfectly. 🙁

Reply
Sridevi - July 3, 2014

thanks. solved my issue.

Reply
Meet Prajapati - August 29, 2014

i want just source code. plz provide it to me..its urgent

Reply
George Varghese - October 14, 2014

this helped me a lot thanks.

Reply
Prajakta - December 16, 2014

I am facing same issue with webservice. So i tried solution given here but still issue persist.
Any idea how to get it work

Reply
    Mark Perry - April 17, 2015

    Can you email us more of an example of your issue?

    Reply
haris rahmanto - January 6, 2015

Terima kasih banyak.. (Bahasa Indonesia),
it’s mean Thank you very much..

Reply
Avinash Khapekar - August 5, 2015

thanks for ur help…good job 🙂

Reply
NIrmal - September 12, 2015

Thanks a lot…

Reply
Anand - April 1, 2016

In my case, I have 2 asmx files in a csproj. In one asmx file, I am able to Invoke Web Methods but getting the same error (The test form is only available for requests from the local machine.) for other file.
Can you please let me know whether any other setting needs to be changed?

Reply
    Mark Perry - April 8, 2016

    Hmmm.. In my project I have two asmx files as well. But have no issues.

    Reply
RCS - April 29, 2017

Thanks For Solution. It Works.

Reply

Leave a Reply: