Back to Basics – How to Invoke Web Methods from a Remote Machine
Back to Basics – How to Invoke Web Methods from a Remote Machine
I’ve been
asked today
how to enable
invocation of
WebMethods of
an asmx web service
from a remote machine
for testing.
The post holds the answer.
How to Invoke Web Methods from a Remote Machine?
Sometimes we want to test our asmx web service not from
localhost but from a remote machine. Trying to open the test form
of the web service from a remote machine will show the following
message: “The test form is only available for requests from the local
machine”. In order to enable the invocation we need
to go the the web service’s configuration file and add to the
system.web element the following configuration:
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
The configuration will enable the protocols of Get and Post on the
service and that is it.
Pay attention – you should use this configuration only in develop or
test environments. Also, this ability is only available for simple types.
Trying it with complex types won't work.
Summary
Enabling test invocation from a remote machine is very easy. It include
simple configuration and it will work. Don’t forget to use it only in
develop or test environments.
Enjoy!