views:

98

answers:

3

Hi,

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 kind a hard to read / interpret with its format, too much information is returned

people from various departments would execute different queries ( HTTP Request) and i wanted them to display simple XML or atleast something more user friendly like HTML

I have tried ACCEPT attribute of the request to be plain XML and it still returns ATOM

Thanks -- Khalil

A: 

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.

marc_s
A: 

Hi Marc

Thanks for your reply

Aactually, I am trying to avoid building a client app for the ado.net service the reason is, since I m exposing the service for read only operation and its internal to our organization and i had build almost all the desired queries as URLS using ($filter etc) Therefore wanted the ability to directly hit the URL in the browser and see the result. ATOM feed is just too much data for a naive user.

khalil
+1  A: 

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

dmportella