ASP.NET Webservices "The test form is only available for requests from the local machine"

ASP.NET Webservices have reduced the complexity involved in developing web services, thanks to tools like Visual Studio .NET, Visual Studio 2005 which reduce the over head of manually creating the proxy files and schema.

We can invoke a service by browsing the <ServiceName>.asmx file and trying to invoke the webmethods available, from the local machine.

However, the webservice is a scenario where, usually the service lies on a different machine other than the machine where the application which consumes the service, resides.

If we would like to invoke the service from other machine, by default, it would display the message "The test form is only available for requests from the local machine."

To enable the Service to be invoked from remote machine, we need to add the following settings to the Web.Config file of the Web Service Application.


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

This would enable the Web service to be able to be invoked from remote machine. However, this invoking would work only for simple data types and would not work in the case of complex datatypes.

Similarly, this setting would only be useful in development / testing scenarios and it is advisable to remove / comment the above section when releasing for production, due to security reasons.

This articles applies to both .NET 1.1 as well as .NET 2.0.

Cheers and Happy Web Servicing !!!

Print | posted on Saturday, March 25, 2006 8:58 AM

Comments on this post

# re: ASP.NET Webservices - Invoking Webmethods from Remote Machine

Requesting Gravatar...
This was very useful and there is no need to build the client separately for each of the web service
Left by Saravana on Apr 21, 2006 6:46 AM

# re: ASP.NET Webservices - Invoking Webmethods from Remote Machine

Requesting Gravatar...
Hi harish, u r a genious! Thanks a lot for this post! It works like a charm , even on windows azure:)
Left by Saran on Jan 07, 2010 5:50 PM

# re: ASP.NET Webservices - Invoking Webmethods from Remote Machine

Requesting Gravatar...
Thank You very much! Works perfectly and is much appreciated :-)
Left by Mark on Jan 12, 2010 11:04 AM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
Thanks,Harish.It works fine. :-)
Left by Nilesh on Mar 10, 2010 12:00 AM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
I have added Directly in machine.config and it worked. Thanks
Left by Sachin on Apr 07, 2010 12:08 AM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
Thanks for the great information...
Left by izmir temizlik firmaları on Apr 30, 2010 9:17 PM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
Hi,
thanks dear, it is working cool!!!!!...once again thanks for ur update.....


Left by jyothiraj on Jul 15, 2010 8:21 PM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
ya da man!
Left by vovo on Sep 09, 2010 5:55 PM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
internett dyıstırmekkmii
Left by temizlik şirketleri izmir on Nov 01, 2010 2:35 AM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
Thanks sir! Just what I needed!
Left by Nicolas Coba on Nov 16, 2010 7:40 PM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
works like magic... ayos!!!

Left by Sev on Feb 21, 2011 2:19 PM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
Thanks. This works great to test from the provided web based test page, but when I try to access the web service from a console based test program by doing:

ServiceReference1.WSSoapClient Client = new ServiceReference1.WSSoapClient();

I get the error message:

An endpoint configuration section for contract 'ServiceReference1.WSSoap' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.

My web.config looks like this:

<?xml version="1.0"?>

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->

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

My guess is that I need a better web.config.

Any ideas?
Left by Joel on Jul 08, 2011 10:57 PM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
thnk u very much
Left by mkoaik on Oct 11, 2011 12:22 PM

# re: ASP.NET Webservices "The test form is only available for requests from the local machine"

Requesting Gravatar...
This is nice but if it isn't good for production then how do my clients that need to hit one of the methods of the web service see the return value?
Left by Kraznodar on Nov 16, 2011 9:28 PM

# izmir temizlik şirketi

Requesting Gravatar...
bu nası bi yorum sayfası bırazdaha buyuk olamazmıydı?
Left by izmir temizlik on May 22, 2012 2:54 PM

Your comment:

 (will show your gravatar)