locked
Resource not found for segment 'xxxxx' RRS feed

  • Question

  • When using the data services client to refresh an entity by calling the LoadProperty:

    ctx.BeginLoadProperty(this, "Owner", (IAsyncResult ar) => ...

    It throws an error on the server if the property is null

    Error: Exception Thrown: System.Data.Services.DataServiceException: Resource not found for the segment 'Owner'.
       at System.Data.Services.RequestDescription.GetSingleResultFromEnumerable(SegmentInfo segmentInfo)
       at System.Data.Services.DataService`1.CompareETagAndWriteResponse(RequestDescription description, ContentFormat responseFormat, IDataService dataService)
       at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService)
       at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)
       at System.Data.Services.DataService`1.HandleRequest()

    Problem is that the client does not know whether the property is null or just hasn't been populated yet.  The property Owner is a link from a Vehicle to a Customer.

    Any ideas what's wrong?

    Thanks
    Tuesday, February 3, 2009 12:59 AM

Answers

  • Hello Jif,
    Looks like the "Owner" property from that Vehicle did not return any results to the server. Instead of using the client, can you query against the particular Vehicle in IE, and then check the Owner's link?
    Can you also share the Metadata for your service? If you can't post it publicly, you can PM me or Phani, we will help you figure this issue out.

    Regards,

    PQ

    Peter Q.
    Thursday, March 5, 2009 11:12 PM
    Answerer

All replies

  • Is this a known bug?
    Sunday, March 1, 2009 1:15 PM
  • Hi Jif,

     What is the type of the entity which is refernced with "this" ?
     and also , if you browse to  theUriforthis/Owner , do you see an entity being returned ?

    Phani Raj Astoria
    Wednesday, March 4, 2009 3:25 AM
    Moderator
  • this is a "Vehicle" entity and the "Owner" is a link for the owner of the car.  There's not always an owner so the link can be null.  When it is the server throws the error.

    The entity does not get returned in a browser because it's a server error.

    Thanks
    Wednesday, March 4, 2009 10:10 AM
  • Hello Jif,
    Looks like the "Owner" property from that Vehicle did not return any results to the server. Instead of using the client, can you query against the particular Vehicle in IE, and then check the Owner's link?
    Can you also share the Metadata for your service? If you can't post it publicly, you can PM me or Phani, we will help you figure this issue out.

    Regards,

    PQ

    Peter Q.
    Thursday, March 5, 2009 11:12 PM
    Answerer