Back to Basics – How to Invoke Web Methods from a Remote Machine

November 8, 2009

Back to Basics – How to Invoke Web Methods from a Remote Machine


I’ve been Back to Basics – How to Invoke Web Methods from a Remote Machine
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!


DotNetKicks Image

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

2 comments

  1. zaza156December 25, 2009 ב 11:09

    I want to quote your post in my blog. It can?
    And you et an account on Twitter?

    Reply
  2. Gil FinkDecember 26, 2009 ב 11:32

    zaza156 you can quote the post.

    Reply