Hello All,
I have a JSON list am trying to send to a custom service.
[
{
"EmployeeId":"ERS/CONS/67898",
"Gross":30567.90,
"NetPay":7890.89,
"EmployeePension":578564,
"EmployerPension":898789,
"PAYE":68798
}
,
{
"EmployeeId":"ERS/CONS/9087",
"Gross":30567.90,
"NetPay":7890.89,
"EmployeePension":578564,
"EmployerPension":898789,
"PAYE":68798
}
,
{
"EmployeeId":"ERS/CONS/6745",
"Gross":30567.90,
"NetPay":7890.89,
"EmployeePension":578564,
"EmployerPension":898789,
"PAYE":68798
}
,
{
"EmployeeId":"ERS/CONS/2345",
"Gross":30567.90,
"NetPay":7890.89,
"EmployeePension":578564,
"EmployerPension":898789,
"PAYE":68798
}
]
The code for the custom service is as follows;
[
DataCollectionAttribute(Types::Class, classStr(ERSPayrollRecordContract)),
]
public str createRecords(List _records)
{
ERSPayrollRecordContract payrollRecord;
ListEnumerator listEnum = _records.getEnumerator();
str txt="";
while(listEnum.moveNext())
{
payrollRecord = listEnum.current();
txt +=strFmt("%1, ", payrollRecord.EmployeeId());
}
return txt;
}
but i get this error in my API tester
"Message": "An exception occured when deserializing a parameters - Exception occured when parsing the request content - Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1.",
"ExceptionType": "XppServicesDeserializationException",
"ActivityId": "d3e970ed-9630-0003-20fd-e9d33096d401"
}
Please what am i doing wrong