It works great in Excel 2013 as a data source. In earlier versions, for example. Excel 2010 there is a workaround described here: http://aspnetwebstack.codeplex.com/workitem/820
Basically, the default output is JSON, and Excel did not send the proper Accept header to receive the XML. Therefore, you should add this to your Web API login function:
IList<ODataMediaTypeFormatter> odataFormatters = ODataMediaTypeFormatters.Create(); var jsonFormatter = odataFormatters .First(f => f.SupportedMediaTypes .Contains(MediaTypeHeaderValue.Parse("application/json"))); odataFormatters.Remove(jsonFormatter); odataFormatters.Add(jsonFormatter); config.Formatters.InsertRange(0, odataFormatters);
source share