locked
requestion results in json versus XML from silverlight RRS feed

  • General discussion

  • Is it just me or does anyone else think it would be nice if the silverlight version of DataServiceContext had a way to specify what format you want the results in?  For large datasets, all the tags and nesting in the XML add a fair performance penalty, so I would like to use JSON - but unfortunately there is no easy way to do that, because even if you add $format=json onto your request, IIS is going to ignore it because the request-headers that get generated by the context don't have the right "Accept" in them.  There are hacks like this to work around this problem:

    http://josheinstein.com/blog/index.php/2010/05/wcf-data-services-format-json/

    But any chance you could just add a method or some mechanism to request JSON over XML that doesn't require so many hoops that shouldn't be necessary?

    Friday, October 28, 2011 7:23 PM

All replies

  • Even if you would make the request ask for JSON, the client library doesn't know how to read it. So it wouldn't work. If your main concern is size of the message (and thus performance) I would suggest you look into using GZip over the ATOM content.

    Thanks,


    Vitek Karas [MSFT]
    Saturday, October 29, 2011 11:20 AM
    Moderator