问题
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 are viewing a feed that contains frequently updated content..."
message and none of the XML is displayed because it must not understand the Atom content element. However I can easily make this same RESTful call in Chrome or even use Fiddler and see the repsonse just fine.
Is there some reason IE cannot parse the XML returned from my WCF data service, or setting I can change to view it directly? I obviously have work-arounds so this isn't a critical issue but it would help if I have to use IE to view the response.
Thanks!
回答1:
If you want to view in IE8 the XML, click
Tools > Internet Options.
- Tools > Internet Options.
- Select the Content Tab
- Under Feeds and Web Slices, select Settings
- 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.
回答2:
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:
- View the pages's source in IE. Guess what the output is there!
- Use Fiddler to inspect the response.
- 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.
回答3:
Make sure you call
response.setCharacterEncoding("text/xml;charset=utf-8");
or the equivalent.
回答4:
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).
来源:https://stackoverflow.com/questions/10341319/why-doesnt-ie-parse-the-xml-returned-from-a-wcf-data-service