Thursday, July 7, 2011

SharePoint 2007 RSS Viewer unexpected error 407 proxy authentication error

SharePoint is hosted in a DMZ which does not have access to internet. User adds a new RSS viewer webpart on a sharepoint team site and gets the famous error "Unexpected error has occured."

The easiest resolution is to contact the corporate security team to open ports so that the web part can get the requested rss feed. But some rss feeds are hosted on environments which keep changing their IP addresses. This will cause the webpart to stop working after some time and we cannot keep requesting security to open ports based on new IP addresses.

ULS logs indicates either one of the following errors,
a. Connection timed out
b. Connection was closed forcibly.
c. 407 proxy authentication failed.
I could not use the following solution because it is not allowed as per security policies,

Here are two options out of which I implemented option 1,

1. The external DMZ machines could talk to a special server on http port which could then talk to another environment from where we could access the rss feed from the internet. Use System.Net.WebClient and WebProxy classes.

2. Client side programming logic. This would work if the rss feed is accessible from the client and not from the server.
a. On each page loads, use javascript to check server cache if feeds already exist.
b. If cache does not exist, use javascript to get rss feeds using a proxy server.
c. Cache rss feed result on server.
Prefrebly use JQuery or Javascript xmlhttprequest.

No comments:

Post a Comment