Question

Issue

The issue that I'm currently seeing is that this error occurs on a call that used to work after I upgraded the client & server to OData 6.2.

Error Message

System.InvalidOperationException: The response payload is a not a valid response payload. Please make sure that the top level element is a valid Atom or JSON element or belongs to 'http://docs.oasis-open.org/odata/ns/data' namespace.

Potential Reference as a Known Issue

Known Issue: Type casting for complex type in $filter and $select is not supported http://blogs.msdn.com/b/odatateam/archive/2014/04/14/odl-6-2-release-announcement.aspx

I'm having a hard time finding a description on https://odata.codeplex.com/

Files

This .zip file contains a VS2013 project which can reproduce the issue. Please check the included README.txt for more information

https://onedrive.live.com/redir?resid=F54C6D1E2F64626D!123&authkey=!AFFjgxLWNUm0U9k&ithint=file%2c.zip

Was it helpful?

Solution

The fiddle file shows that the payload is in OData V3, and you were trying to read it using OData V4 client.

Your server code use assembly "Microsoft.AspNet.WebApi.OData", it is Web API on OData V3. The Web API 2.2 is for OData V4.

See here:Getting started with ASP.NET Web API 2.2 for OData v4.0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top