0

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?

bheklilr
  • 53,530
  • 6
  • 107
  • 163
user855803
  • 11
  • 1
  • 5

1 Answers1

2

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)

user692942
  • 16,398
  • 7
  • 76
  • 175
  • The SData forum no longer exists and http://interop.sage.com/daisy/sdata/ (Sage SData Core Specification 1.1) link is broken – Evan Dec 22 '15 at 15:31
  • @Evan the answer is 2+ years old but thanks for the nudge, have updated the answer. – user692942 Dec 22 '15 at 15:46
  • When there's only 10 questions for the SDATA tag I figured I could scour all of them for resources and was really disappointed when I found that the forum had been closed. – Evan Dec 22 '15 at 16:00
  • @Evan It was a really useful resource, annoyed they just closed it and didn't update it or provide something else. Had lots of useful information on there from one of the lead developers of SData. – user692942 Dec 22 '15 at 16:18
  • Any chance I could pick your brain on sdata? I have an outstanding question about creating customers – Evan Dec 22 '15 at 17:35
  • @Evan Post a question and I'll do my best to help, while since I lasted worked with it but I'll try. – user692942 Dec 22 '15 at 17:54
  • Sure, here's the link: http://stackoverflow.com/questions/34419127/sage-300-accpac-sdata-create-customer – Evan Dec 22 '15 at 18:25