Reputation: 11
I am working on Sage SData integration. Unfortunately, there is a problem in sending data to the server. I am able to retrieve data and delete contract but when I add new contract through POST
or update through PUT
, it gives an error:
error ApplicationDiagnosis Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection
Does any one have a PHP or JSON example of adding a new contract?
Upvotes: 0
Views: 1520
Reputation: 16682
Do you have an example of the endpoint your trying to get to?
My guess would be your trying to access an endpoint that doesn't return anything, the web server still tries to serve you a atom feed but fails. I have had this numerous times while working with SData until I find the correct endpoints for the Resource Kinds I'm wanting to work with.
Couple of tips
SData URL takes the following form;
<protocol>://<hostname>:<port>/sdata/<application>/<contract>/<resourcekind>?<queryparameters>
Couple of useful system urls which may help you discover registered endpoints easier;
<protocol>://<hostname>:<port>/sdata/$system
(List all system endpoints)<protocol>://<hostname>:<port>/sdata/$system/adapters
(List installed adapters)<protocol>://<hostname>:<port>/sdata/$system/registry/endpoints
(List of registered endpoints)You may find help more readily available from the following resources;
http://sdata.sage.com/ (Sage SData Portal)
http://sage.github.io/SData-2.0/pages/core/0100/ (Sage SData Core Specification 1.1)
http://sdata.sage.com/SDataForum/ (Sage SData Forum - Useful Resource)(Forum unfortunately has been discontinued)
Upvotes: 2