function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ekennedyekennedy 

API integration Errors

I'm running a php program that queries data from a local database and uses the API to create records in Salesforce.com. The code worked perfectly up until two days ago when I started recieving errors like this:

Error: XML error on line 1 col 4 byte 4 not well-formed (invalid token)
Error: org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
Error: curl_exec error 28 Operation timed out with 1276 out of -1 bytes received

I was wondering if anyone else was having problems like is?
ekennedyekennedy
After some more testing, I was able to pinpoint the issue.

Let's use an example: I am loading 186 records into salesforce.

I tried loading 200 at a time, and got the errors.

I tried loading 100 at a time, the first 100 didn't load, the second 86 did.

I tried loading 50 at a time, the first 50 didn't load, all the rest of them did.

It appears that at the first login, it fails, but on all subsequent ones it succeeds. This wasn't a problem until 2 days ago, does anyone know what's going on?
dhruvadhruva
Looks like there's something wrong with your first 50 records, rather than with the API. Possibly only one of these first 50. You could keep doing your binary search and isolate the record with the problem.
SuperfellSuperfell
can you tell if that's an error from the server, or a xml parsing error on the response? I tend to agree with dhruva, and that's its a parsing error being thrown by the server because it couldn't parse your request