Ryan Lege
Ryan Lege

Reputation: 167

WCF Data Services ODATA throwing error with JSONP

Ok so I have a WCF ODATA service hosted locally for testing purposes. Then I have a Kendo Grid trying to query the service using a Kendo Datasource configured for ODATA exactly like the demo!

On the deployed service, I also implemented the "JSONPSupportBehavior" attribute and class that everyone is talking about!

Still I get this in Fiddler : A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) 'application/atom+xml;type=feed, application/atom+xml, application/json;odata=verbose' do not match any of the acceptable MIME types 'application/json'

Is this IIS issue now or something else? This is driving me crazy!

Upvotes: 0

Views: 1537

Answers (1)

Vitek Karas MSFT
Vitek Karas MSFT

Reputation: 13320

This is a change made in the WCF Data Services release. In order to get JSON response back (or JSONP) you need to send Accept header with value application/json;odata=verbose. Pure "application/json" is now reserved for the soon to be coming JSON Light format. See http://blogs.msdn.com/b/astoriateam/archive/2012/04/11/what-happened-to-application-json-in-wcf-ds-5-0.aspx for more details.

Upvotes: 1

Related Questions