I just downloaded SharpReader v0.9.7.0 and subscribed to an RSS feed from a site running ELMAH BETA 2 (1.0.9414.1441) and it managed to pick up the feed and subscribe to it without any issues.
>>
Error parsing RSS XML: Not a valid xml document: This is an unexpected
token. The expected token is 'WHITESPACE'. Line 2, position 62.
<<
Have you tried to sniff the response and see SharpReader is getting? Did you provide http://serveur/clemex/elmah.axd as the URL to the feed to SharpReader?
Also I did a test and copied the source from this feed and put it in a
different xml file that I later published on the same
server(http://serveur/clemex/rss/test.xml). Then I subscribed to this
feed and guess what, it worked fine.
You mentionned something about sniffing the response that Sharpreader is
getting but I don't really know how to do that. Can you elaborate on
this.
Thanks,
Eric
That'll work fine and http://serveur/clemex/elmah.axd, without slash-rss appended, should also work equally well. In my testing, I didn't specify slash-rss. The error log page in ELMAH contains a hint to where the feed is located and SharpReader is good enough use that hint (like most modern feed readers).
>>
You mentionned something about sniffing the response that Sharpreader is
getting but I don't really know how to do that. Can you elaborate on
this.
>>
Use Fiddler, available from http://www.fiddlertool.com/.
With Fiddler what am I supposed to look for? The raw is giving me the
following:
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Tue, 11 Mar 2008 18:14:36 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/xml; charset=utf-8
Content-Length: 1958
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="0.91">
<channel>
<title>Error log of /LM/W3SVC/1/Root/Clemex on SERVEUR</title>
<link>http://serveur/clemex/elmah.axd</link>
<description>Log of recent errors</description>
<language>en</language>
<item>
<title>The file '/clemex/intranet_home.aspx' does not
exist.</title>
<description>An error of type System.Web.HttpException occurred.
The file '/clemex/intranet_home.aspx' does not exist.</description>
<pubDate>Tue, 11 Mar 2008 18:00:20 GMT</pubDate>
<link>http://serveur/clemex/elmah.axd/detail?id=020D724E-62E2-4D3A-BDE4-
7C5931DD8D9A</link>
</item>
<item>
<title>The file '/clemex/intrabet_home.aspx' does not
exist.</title>
<description>An error of type System.Web.HttpException occurred.
The file '/clemex/intrabet_home.aspx' does not exist.</description>
<pubDate>Tue, 11 Mar 2008 18:00:16 GMT</pubDate>
<link>http://serveur/clemex/elmah.axd/detail?id=0B546E2A-7170-49FA-8C9B-
3508CA02839D</link>
</item>
<item>
<title>The file '/clemex/Cl_Leads.aspx' does not exist.</title>
<description>An error of type System.Web.HttpException occurred.
The file '/clemex/Cl_Leads.aspx' does not exist.</description>
<pubDate>Mon, 10 Mar 2008 20:33:52 GMT</pubDate>
<link>http://serveur/clemex/elmah.axd/detail?id=5908382F-8A7D-4C5F-9002-
605CC5BCD292</link>
</item>
<item>
<title>The file '/clemex/customer.aspx' does not exist.</title>
<description>An error of type System.Web.HttpException occurred.
The file '/clemex/customer.aspx' does not exist.</description>
<pubDate>Mon, 10 Mar 2008 20:33:27 GMT</pubDate>
<link>http://serveur/clemex/elmah.axd/detail?id=E619C733-C3D8-41EA-A30F-
67CA7530DAD4</link>
</item>
</channel>
</rss>
I also tried 2 other readers but they all give me an error when I try
one or the other URL.
RssReader 1.0.96.2 Beta
Error: Feed nota a valid RSS or Atom format, maybe the provided feed URL
point to a HTML page instead of RSS or Atom feed.
RSS Bandit
Error: Sorry, no feed could be found
At the bottom of the page http://serveur/clemex/elmah.axd I see Powered
by ELMAH, version 1.0.9414.1441
On the About page I can read: This release (SCC #248) build was compiled
from the following sources for CLR v2.0.50727:
Thanks again for trying to help,
To get back to your latest question well it makes no difference, all
readers are not able to read neither of them
-http://serveur/clemex/elmah.axd/digestrss
-http://serveur/clemex/elmah.axd/ or
-http://serveur/clemex/elmah.axd/rss
Thanks.
Even from the start (empty log) I was getting the same error but just to
be sure let me empty my logs and I will post back the request and
response as well. This might sound stupid but could you tell me how to
clear the logs? Do I have to clear the table directly or their is some
other way?
Thanks, but unfortunately, I was expecting the RSS response. You've sent the response from the error log home page that contains only HTML.
> Do I have to clear the table directly or their is some other way?
If you're using the SQL Server then you have to manually clear the table. If you're using SQLite database file or XML files for log then you just delete those. There's no UI for clearing the log.
>>
Also I did a test and copied the source from this feed and put it in a different xml file that I later published on the same server(http://serveur/clemex/rss/test.xml).
<<
What if you were to take the static test.xml and rename it to test.aspx while maintaining the content. Does SharpReader fail then? I'm wondering if there's something in the ASP.NET pipeline that's corrupting the response.
- Atif
>>Have you tried with a different RSS reader?<<
Yes I tried 3 different readers. As previously mentionned:
"I also tried 2 other readers but they all give me an error when I try
one or the other URL.
RssReader 1.0.96.2 Beta
Error: Feed nota a valid RSS or Atom format, maybe the provided feed URL
point to a HTML page instead of RSS or Atom feed.
RSS Bandit
Error: Sorry, no feed could be found"
>>What does IE 7 show when you try to view the feed directly in the
browser?<<
It looks normal to me, here is the source viewed by IE7:
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="0.91">
<channel>
<title>Error log of /LM/W3SVC/1/Root/Clemex on SERVEUR</title>
<link>http://serveur/clemex/elmah.axd</link>
<description>Log of recent errors</description>
<language>en</language>
</channel>
</rss>
>>What if you were to take the static test.xml and rename it to
test.aspx while maintaining the content. Does SharpReader fail then? I'm
wondering if there's something in the ASP.NET pipeline that's corrupting
the response.<<
I changed the extension to aspx instead of xml
(http://serveur/clemex/rss/test.aspx) as you suggested and tried to
subscribe to the feed and It does fail with the same error. I changed
back the extension to xml and sharpeReader was able to subscribe.
Given this observation, I imagine then that there is another component in the pipeline (another HTTP module or handler registered in web.config or machine.config?) that seems to be interfering with the output. It doesn't look like it's a problem originating from ELMAH.
<httpModules>
<add name="ScriptModule"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ErrorLog" type="Elmah.ErrorLogModule,
Elmah"/>
</httpModules>
<globalization requestEncoding="utf-8"
responseEncoding="utf-8" culture="en-US" uiCulture="en"/>
<authentication mode="Forms">
<forms loginUrl="login.aspx" protection="All"
timeout="43200" path="/" requireSSL="false" slidingExpiration="true"
cookieless="UseCookies" name=".ClemexIntFormAuth"/>
</authentication>
<authorization>
<!-- <allow users="?" /> -->
<deny users="?"></deny>
</authorization>
<!-- <xhtmlConformance mode="Legacy"/>-->
</system.web>
<system.webServer>
<validation
validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule"
preCondition="integratedMode" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove
name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*"
path="*.asmx" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices"
verb="*" path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource"
preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ASBXHandler" verb="GET,HEAD,POST"
path="*.asbx" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration>
<authentication mode="Forms">
...
</authentication>
<authorization>
<!-- <allow users="?" /> -->
<deny users="?"></deny>
</authorization>
I believe the SharpReader is trying to access your web site like an anonymous user. Could it be then that it's getting back the HTML from the login screen instead of the RSS feed? It tries to parse the HTML as XML and RSS but obviously fails. This would explain why the static copy of the feed works when it has the XML extension but fails when it uses ASPX. The XML extension is handled and served directly by IIS. ASP.NET is not involved so there is no authentication challenge taking place. When the same file is renamed to have an ASPX extension then the ASP.NET pipeline gets involved. To confirm this theory, could exclude elmah.axd from the authorization rule or turn off authentication and authorization temporarily to see if SharpReader can then get to the feed.
<location path="elmah.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
Thanks for all your help Atif,
http://msdn2.microsoft.com/en-us/library/aa479391.aspx