Why doesn't IE parse the XML returned from a WCF Data Service?

后端 未结 4 2453
醉梦人生
醉梦人生 2021-02-20 18:24

I am currently running IE8 and am doing some testing with WCF data services. When I make a call to one of my collections in the browser I get the

\"You a

相关标签:
4条回答
  • 2021-02-20 18:44

    If you want to view in IE8 the XML, click

    Tools > Internet Options.

    1. Tools > Internet Options.
    2. Select the Content Tab
    3. Under Feeds and Web Slices, select Settings
    4. Under Advance section untick Turn on Feed reading view

    If you now review your OData page, the feed viewer will not be showing, but the data will be displayed in XML.

    0 讨论(0)
  • 2021-02-20 18:54

    IE 8 and 9 just do not support displaying the OData - Atom Pub feed output. In IE9, the following explanation is provided:

    Internet Explorer does not support this feed format.

    Supported feed formats

    • ATOM 0.3, 1.0
    • RSS 0.91, 0.92
    • RSS 1.0
    • RSS 2.0

    However, there are several easy ways to still view the output from the DataService RESTful call:

    1. View the pages's source in IE. Guess what the output is there!
    2. Use Fiddler to inspect the response.
    3. Use another browser like Chrome and the response will be output directly in the browser.

    Maybe IE 10 will have better support of displaying and supporting a feed based on a protocol (OData) created by the very people that created and own IE: Microsoft.

    0 讨论(0)
  • 2021-02-20 18:58

    You need to disable feed reading view: http://blogs.msdn.com/b/darrenliu/archive/2011/01/26/turn-rss-feed-reading-view-off.aspx.

    I'm having the opposite problem, Chrome won't show the raw XML anymore for me (I swear it used to).

    0 讨论(0)
  • 2021-02-20 19:02

    Make sure you call

    response.setCharacterEncoding("text/xml;charset=utf-8");
    

    or the equivalent.

    0 讨论(0)
提交回复
热议问题