c# - Reading Json output from Odata services -
i trying read output odata services in json format. getting error message
"the response payload not valid response payload. please make sure top level element valid atom or json element or belongs 'http://schemas.microsoft.com/ado/2007/08/dataservices' namespace".
northwindentities dc = new northwindentities(new uri("http://services.odata.org/v3/northwind/northwind.svc/"),dataserviceprotocolversion.v3); dc.format.usejson(new edmmodel()); dataservicequery<product> query = (dataservicequery<product>)from o in dc.products o.unitprice > 0 select o; query.execute(); {"odata.metadata":"http://services.odata.org/v3/northwind/northwind.svc/$metadata#products","value":[{"productid":24,"productname":"guaran\u00e1 fant\u00e1stica","supplierid":10,"categoryid":1,"quantityperunit":"12 - 355 ml cans","unitprice":"4.5000","unitsinstock":20,"unitsonorder":0,"reorderlevel":0,"discontinued":true},{"productid":33,"productname":"geitost","supplierid":15,"categoryid":4,"quantityperunit":"500 g","unitprice":"2.5000","unitsinstock":112,"unitsonorder":0,"reorderlevel":20,"discontinued":false}]}
you json string not valid has property name '.' in it. odata.metadata cannot resolved.
if changed odata_metadata, or possible went solution provided here: enter link description here
Comments
Post a Comment