Dotnetdreamer's Weblog

SharePoint, Silverlight and Azure

Security Exception in HttpWebRequest.EndGetResponse

Posted by Ramprasad Navaneethakrishnan on February 22, 2013

If you get a security exception during the call to HttpWebRequest.EndGetResponse, you might want to try the following to fix it.

1. Install and open Fiddler(http://www.fiddler2.com/fiddler2/version.asp)

2. Create ClientAccessPolicy.xml file as mentioned in the section “To use clientaccesspolicy.xml file to allow cross-domain access” in the link http://msdn.microsoft.com/en-us/library/cc197955(v=vs.95).aspx

3. See if the problem is fixed. If not, inspect the http request in fiddler. It will tell, whether it was able to find the clientaccesspolicy.xml file or not. In case of a 404 error, it will tell the place where it was looking for this xml file. In my case, it turned out to be in c:\inetpub\wwwroot.

 

Hope it helps.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: