Friday, August 31, 2007

.NET Web Service error - "The test form is only available for requests from the local machine"

I faced this error before.
I used my local pc's window service application to call a web service function at server (different pc) but it is fail. It cannot work like when I used the same window service application to call the same web service function at local pc.

Then, I tried to browse to the web service through ie. When I click the fuction, it showed the message - "The test form is only available for requests from the local machine"

After that, I found the solution to fix it. I just added in some code inside the
web.config file then the this problem is solved. The code I added in is like below:

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