Summary:

Adding an RSS feed gadget to the interactive dashboard may throw an error if the feed site has Basic authentication enabled.

Symptoms:

On creating an RSS feed gadget on the Interactive Dashboard, the gadget displays the following error message:

 An error occurred when attempting to process the Gadget. 
        Please contact your System Administrator.         

The following error message appears in the scrm.log:

ERROR [http-apr-18009-exec-6]: 20-Feb-2014 11:29:36.240 Server response status code != 200 (500)

The following entry can be seen in the localhost_access_log:

127.0.0.1 - - [20/Feb/2014:12:46:55 +0000] "GET /crmj/proxy?url=http%3A%2F%2Frsswebsite.com%2Factivity%2Flog%2Flist%3Ffmt%3Drss&SID=4587433135352&contextEntityId=-1&contextRecordId=-1 HTTP/1.1" 500 34

Using the Fiddler web debugging proxy, the following request and response can be seen when attempting to load the gadget:

Request:

GET http://crmserver/sdata/crmj/proxy?url=http%3A%2F%2Frsswebsite.com%2Factivity%2Flog%2Flist%3Ffmt%3Drss&SID=4587433135352&contextEntityId=-1&contextRecordId=-1 HTTP/1.1
Accept: */*
Accept-Language: en-ie 
Referer: http://crmserver/crm/InteractiveDashboard/DD92B24B48FD4B8ADD4425BB8DF616B8.cache.html
Authorization: Basic YWRtaW46
x-sage-authorization:
Basic QWRtaW46
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Host: crmserver
DNT: 1
Connection: Keep-Alive

Cookie: ASPSESSIONIDQCBSCTDC=PBINBGPAJNLJGKNCBGBHGFPK; ASPSESSIONIDQCARCTCD=IIDLHIHCLMAJEIJBNIKANINP; ASPSESSIONIDQCBTDSCC=IEFPLHICGMIKNPNFDEHDOGPO; ASPSESSIONIDSACRDSCD=KICJAIOCPECFGGIDDPPBJALD

Response:

HTTP/1.1 500 Internal Server Error
Cache-Control: no_cache
Pragma: no_cache
Content-Type: text/plain;charset=utf-8
Content-Language: en-IE
Expires: Thu, 01 Jan 1970 00:00:00
GMT Server: Microsoft-IIS/7.5
X-Rewritten-By: ManagedFusion (rewriter; reverse-proxy; +http://managedfusion.com/)
X-ManagedFusion-Rewriter-Version: 3.5
Set-Cookie: JSESSIONID=AE00A3AA4B52F5B2D5148917EE6250AE; Path=/crmj/; HttpOnly
X-Powered-By: ASP.NET
Date: Thu, 20 Feb 2014 12:47:59 GMT Content-Length: 23

Error 401: Unauthorized

 

Cause:

The issue was caused by the Authorization: Basic header being forwarded on to the website providing the RSS feed. Since the CRM username and password does not represent a valid account on the RSS provider's site, a 401 (Unauthorized) response is returned. This results in an error 500 being thrown within the CRMJ webapp.

Resolution:

A fix will be included in a future patch release. the issue can be worked around by creating a custom proxy ASP page that forwards on a request to your RSS provider. The forwarded request does not contain the headers that caused this issue.

Save the following as RSSProxy.asp in your \CRM\WWWRoot\CustomPages\ directory.

<%@ Language= "Javascript" %>
<%

/*  Usage: Save this file to your CRM web server as RSSProxy.asp;
    the ..\CRM\WWWRoot\CustomPages directory is fine.

    When creating an RSS gadget, pass a HTTP-encoded URL as the RSSUrl parameter, e.g.:
    http://crmserver/crm/CustomPages/RSSProxy.asp?RSSUrl=http%3A%2F%2Frsswebsite.com%2Factivity%2Flog%2Flist%3Ffmt%3Drss

    You can HTTP encode your URL using the Javascript encodeURIComponent(string) function, otherwise
    do it here: (External tool) http://meyerweb.com/eric/tools/dencoder/

    Alternatively, your URL can be saved to this file as the RSSUrl var.
*/

var RSSUrl=Request.QueryString("RSSUrl");

var myxmlhttp;
var ErrorText = '';
var sContents = '';

doRequest(RSSUrl);
sContents = myxmlhttp.responseText;

Response.Write(sContents);

function doRequest (url) {

    myxmlhttp = CreateXmlHttpReq(resultHandler);

    if (myxmlhttp) {
        XmlHttpGET(myxmlhttp, url);
    } else {}
}

function resultHandler () {
    // request is 'ready'
    if (myxmlhttp.readyState == 4) {
        // success
        if (myxmlhttp.status == 200) {
            // ok
        } else
            ErrorText = 'HTTP status: ' + myxmlhttp.status;
    }
}

function CreateXmlHttpReq(handler) {

    var xmlhttp = null;
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");

    if (xmlhttp)
        xmlhttp.onreadystatechange = handler;

    return xmlhttp;
}

function XmlHttpGET(xmlhttp, url) {

    try {
        xmlhttp.open("GET", url, false);
        xmlhttp.send();
    }
    catch(exception) {

        ErrorText = "There has been an error"
            + "<br/>Error Name:" + exception.name
            + "<br/>Error Number:" + exception.number
            + "<br/>Error Number:" + exception.number & 0xFFFF
            + "<br/>Error Description:" + exception.description
            + "<br/>";
    }
}
%>

Once this is done, you can then use it as an endpoint for your RSS gadget. You might need to make a few changes (i.e. adding something to handle authorisation headers) if the CRM server is behind a proxy. When you create your gadget, you point it at this page, passing the original RSS URL as the RSSUrl parameter:

http://crmserver/crm/CustomPages/RSSProxy.asp?RSSUrl=http%3A%2F%2Frsswebsite.com%2Factivity%2Flog%2Flist%3Ffmt%3Drss

Status:

The issue was raised to the development team for a fix, and has been resolved in v7.2f.