Tuesday, October 26, 2004

Consuming Web Services with HTTP Post

When I first started working on a web service project a few weeks ago, I put together a small ASPx page that uses HTTP Post to call the web service. This made it somewhat simple to test. I could easily change the input values and re-submit without having to change some code and recompile an application that uses the web service.

This worked great on my laptop where I accessed everything on localhost. As soon as I migrated the project to our development server for testing that all changed. I spent a couple of days trying to figure out if I had inadvertently changed my web service code and caused this problem. I ended up writing that application that I mentioned to see if that would work. To my bewilderment, it did.

After doing some searching, I finally found some very useful information in ASP.NET Unleashed, Second Edition last night that helped solve my problem. For security reasons, in ASP.NET 1.1 a web service can only be accessed using SOAP. HTTP Post and HTTP Get are both disabled by default. HTTP Post still works on a local machine, which is why I did not have a problem at first.

To enable the use of HTTP Post or HTTP Get from remote machines, you will have to edit the Web.Config file for your project:















No comments: