How to return plain XML from ADO.NET data service
I was wondering how to return plain XML from ADO.net data services
I have exposed an ADO.net data service to different departments in our company who are not so technical. The data returned is ATOM FEED
which is some-what ha开发者_StackOverflowrd to read / interpret with its format and too much information is returned.
People from various departments would execute different queries ( HTTP Request) and I would like them to display simple XML or at least something more user friendly like HTML
I have tried ACCEPT
attribute of the request to be plain XML
and it still returns ATOM
If I were you I would use Friendly feeds which is a feature of WCF Data Services, which allows you to map properties to feed fields which would show as proper rss feeds on any rss feed reader, even the default feed reader from IE 7 and 8 would display them and sort them for you.
WCF Data Services Feed Customization
hope this helps
ADO.NET Data Services - now known as WCF Data Services - will always return an Atom feed - that's the core of their functioning.
You shouldn't have any trouble, however, interpreting and working with that Atom feed. On the client side, you can just do a Add Service Reference
to the service URL, and a nice, clean client-side proxy will be generated, complete with .NET object classes which you can use to read and interpret the output from the WCF Data Service. You can even use LINQ against this client classes to do your queries!
I would recommend you get to know and use Atom, instead of trying to fight it.
精彩评论