pofider / node-simple-odata-server

Simple OData server for node.js
MIT License
97 stars 61 forks source link

Fix XML headers for metadata retrieval #10

Closed pickworth closed 9 years ago

pickworth commented 9 years ago

pplication/atom+xml must be defined in the Accept header for some odata clients to function properly.

In my case, this is for Tableau: before, i would get the error: Bad OData Format. Make sure you are using a URL that points to a valid OData Source.

adding application/atom+xml to Accept headers fixes the issue

pofider commented 9 years ago

Thanks for the pull request. However I have some doubts about this one.

I don't see such a response header in the official odata service http://services.odata.org/V4/OData/OData.svc/$metadata

And I don't see Accept would be a common header for the response. It is probably rather a request header.

Isn't the issue with Tableau somewhere else?

pickworth commented 9 years ago

You're right. This did not completely resolve the issue. However, it did make Tableau return a different error, so I thought I was on the right track to success, it appears not so much though, as Tableau doesn't support JSON responses via odata. It works with the atom feed type in v3.0, i know that. I will work on support for atom feeds, which should resolve my integration issue entirely

This may take a while. I'll close this PR myself

I got the tip from the following article: http://stackoverflow.com/questions/23628255/bad-odata-format-when-accessing-odata-feed-from-tableau-8-1

By the way, are there any plans already to support atom type feeds via odata?