Last post Apr 22, 2015 09:08 PM by Paul Linton
Apr 22, 2015 09:09 AM|rajukamatham|LINK
I am consuming OData service. The uri will return pdf document. I am not about what type of data it is returning.
var pbf = context.PBF.Where(a => a.ExternalId == projectRef.Value) + "/$value"; //Here we are generating the URL
ZGW_WS_PPM_ITEM_SRV objZGW_WS_PPM_ITEM_SRV = new ZGW_WS_PPM_ITEM_SRV(new Uri(pbf));
objZGW_WS_PPM_ITEM_SRV.Credentials = new System.Net.NetworkCredential("xxxxx", "xxxx");
var result = objZGW_WS_PPM_ITEM_SRV.Execute<PBF>(new Uri(pbf));
When the last line executes I am getting below error.
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://schemas.microsoft.com/ado/2007/08/dataservices' namespace
Apr 22, 2015 09:08 PM|Paul Linton|LINK
"I am consuming OData service. The uri will return pdf document"
What do you mean by this? OData services and pdf documents are very different things. The error message indicates that this confusion may be your problem, it seems that you are calling something that you think is an OData service but which is not.
What does ZGW_WS_PPM_ITEM_SRV.Execute do? Have you tried stepping into it using the debugger?