Developing Webservices in ASP.NET is now less complex, thanks goes 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 opening URL in browser as <YourServiceName>.asmx and trying to invoke the webmethods available, from the local machine.
Usually the service lies on a different machine other than the machine where the application which consumes the service, resides.
If you will invoke services from other machine, by default, it will give 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 will enable the Web service to be able to invoked from remote machine. However, make a note that 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.
Happy Web Servicing !!!