Cannot consume MediaRss feed generated by Argotic

Topics: Argotic.Core, Argotic.Extensions
Dec 15, 2008 at 5:10 PM
I'm generating an RSS Feed using YahooMediaSyndicationExtension. When I go to consume the feed using Argotic, I get the following exception: The supplied syndication resource has a content format of None, which does not match the expected content format of Rss.

Here's the code I use to consume it:

var settings = new Argotic.Common.SyndicationResourceLoadSettings();

RssFeed feed = RssFeed.Create(new Uri("http://localhost/api/GetContent"), settings);

Any ideas what I'm doing wrong?

Dec 15, 2008 at 10:40 PM
More info and a new error...

Got the latest from CodePlex which got rid of the error above. Now I get this: 

"Data at the root level is invalid. Line 1, position 2."

I'm using ASP.NET MVC to generate my feed with a custom ActionResult:

public class RssResult : ActionResult
public RssFeed RssFeed { get; set; }
public override void ExecuteResult(ControllerContext context) {
context.HttpContext.Response.ContentType = "application/rss+xml";
SyndicationResourceSaveSettings settings = new SyndicationResourceSaveSettings();
settings.CharacterEncoding = new UTF8Encoding(false);
RssFeed.Save(context.HttpContext.Response.OutputStream, settings);

I'm pretty sure this has to do with the BOM, which I can't seem to eliminate. Ideas?
Dec 16, 2008 at 6:18 PM
Even more info....

It now appears that SyndicationEncodingUtility.RemoveInvalidXmlHexadecimalCharacters(xml); is mangling the xml. When I change the next line to using(StringReader reader = new StringReader(xml)) instead of safeXml, it works.

The Data at the root level error you can ignore, that was my error.

For now, I've got it working with this. Let me know if you need any more info (like the output of that method).
Jan 28, 2009 at 12:28 AM
Edited Jan 28, 2009 at 12:28 AM
The code to attempt to remove invalid hexadecimal characters from XML is not always working, I may just have to tear it out until I create something more solid. Thanks for the feedback and detailed information.