locked
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" RRS feed

  • Question

  • User-811139024 posted

    Hi,

    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

    Wednesday, April 22, 2015 9:09 AM

All replies

  • User-1910946339 posted

    "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?

    Wednesday, April 22, 2015 9:08 PM