locked
Resource not found for the segment 'Insertmyrecord' RRS feed

  • Question

  • I add a service operation to data service, and upate the service reference, then I called the service operation in the client side, it give me the following error:

    <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
     <code></code>
     <message xml:lang="en-US">Resource not found for the segment 'Insertmyrecord'.</message>
    </error>

    I hope that one expert can help me to fix these problem.

    Thanks in advance.
    Friday, August 14, 2009 7:00 PM

Answers

  • Hi Jake,
     Can you please check if the ServiceOperationRights in the DataService  are set to allow access to this ServiceOperation ?
     You should enable access to this ServiceOp via config.SetServiceOperationAccessRule("Insertmyrecord",ServiceOperationRights.All);
    Phani Raj Astoria http://blogs.msdn.com/PhaniRaj
    • Marked as answer by Jake Wardley Tuesday, August 25, 2009 5:19 PM
    Sunday, August 23, 2009 4:35 AM
    Moderator

All replies

  • I had this problem as well.

    I fixed this by first creating a top level ObservableEntityCollection
    and then added the entity to that and then called savechanges.

    Then my insert worked.

    I you have trouble please post some information about your database schema and example code that is not working.
    Friday, August 21, 2009 2:14 PM
  • Hi Jake,
     Can you please check if the ServiceOperationRights in the DataService  are set to allow access to this ServiceOperation ?
     You should enable access to this ServiceOp via config.SetServiceOperationAccessRule("Insertmyrecord",ServiceOperationRights.All);
    Phani Raj Astoria http://blogs.msdn.com/PhaniRaj
    • Marked as answer by Jake Wardley Tuesday, August 25, 2009 5:19 PM
    Sunday, August 23, 2009 4:35 AM
    Moderator