SharePoint - System.Net.WebException: The remote server returned an error: (403) Forbidden. at System.Net.HttpWebRequest.GetResponse() at

Asked By Alek Tolstoi on 03-Apr-09 04:16 PM
I am wondering if someone can help me. I have written  a webpart that works on my machine but when i install it on production it blows up with the following error:

System.Net.WebException: The remote server returned an error: (403) Forbidden. at System.Net.HttpWebRequest.GetResponse() at

HttpWebRequest xmlrequest = (HttpWebRequest)WebRequest.Create("http://xml.weather.yahoo.com/forecastrss?p=10038"); HttpWebResponse xmlresponse = (HttpWebResponse)xmlrequest.GetResponse();



The webpart is weather webpart that gets weather information for a given zip code.

I am not sure why this is happening when it works on my dev sharepoint machine.
Can anyone help?

Thanks
Al

Re - Kalit Sikka replied to Alek Tolstoi on 04-Apr-09 02:05 AM

Most likely your web server is set to require ssl and you are trying to use regular http, thus the exception. Go to directory security for your site and make sure Require SSL is not checked
raj replied to Alek Tolstoi on 07-Apr-11 01:46 AM
Hey.. I got the same problem as well.. When I tried to access a Rest Web Service which resides at  a particular url  I got an error message saying that " 403 forbidden". This happened when I deploy the code on the development server which has Windows 2008 server R2 as an OS. It was working fine when I tried to access the service which resides at the same ur;l  from my local machine with a sample application. After deploying the code sharepoint server and tried to access it I got this error message "The remote server returned an error: (403) Forbidden". SSL is unchecked for the site. Please help me out.

Thanks!
Raj