Challenges with Data Conversion and Storage: Addressing Missing Fields and Incorrect Database Form

Hi! How are you?

I have a list of billers that contains JSON objects. Inside these objects, there are further nested objects and arrays.

I wrote pure Java code to save this data into a database table and store the biller list, returned from a third-party, in a file named file.json. The data was successfully stored. However, when I moved the code to Software AG and converted it to JSON, then passed it to a Java service, a field went missing, and the data stored in the database was incorrect.

How can I solve this problem? I used the pub.json:documentToJSONString service to convert this to JSON. Is this the correct way? Or is there another method to convert a document-list to an array of JSON objects?

this is the one object to now the format of the JSON that return form third party
{
“BillerInfo”: {
“Code”: “73”,
“IntegrationType”: “Online”,
“StmtBankSwiftCode”: “12”,
“Website”: “www.test.com”,
“Email”: “bajes.shamale@madfooat.ps”,
“Phone”: “+970592066652”
},
“BillerName”: {
“EnShortName”: “Mad Vouchers”,
“ArShortName”: “ماد كارد”,
“EnName”: “MadfoatCom Vouchers”,
“ArName”: “بطاقات الديجيتال مدفوعاتكم”
},
“BillerCategory”: {
“EnShortName”: “ETRN”,
“ArShortName”: “ترفيه”,
“EnName”: “Entertainment”,
“ArName”: “الترفيه”
},
“BillerServices”: {
“BillerService”: [
{
“ServiceInfo”: {
“Code”: “20176”,
“Type”: “State_of_Survival”,
“EnShortDesc”: “State of Survival”,
“ArShortDesc”: “حرب الزومبي”,
“EnDesc”: “State of Survival”,
“ArDesc”: “حرب الزومبي”,
“PaymentType”: “Prepaid”,
“BillingNoRequired”: “true”,
“ContainsPrepaidCats”: “false”,
“Currency”: “USD”
},
“BillingInfo”: {
“EnShortDesc”: “Mobile Number”,
“ArShortDesc”: “رقم الموبايل”,
“EnDesc”: “Mobile Number”,
“ArDesc”: “رقم الموبايل”,
“Regex”: “^(9705|9725)\d{8}$”
}
},
{
“ServiceInfo”: {
“Code”: “20167”,
“Type”: “LifeAfter”,
“EnShortDesc”: “Life After”,
“ArShortDesc”: “لايف افتر”,
“EnDesc”: “Life After”,
“ArDesc”: “لايف افتر”,
“PaymentType”: “Prepaid”,
“BillingNoRequired”: “true”,
“ContainsPrepaidCats”: “false”,
“Currency”: “USD”
},
“BillingInfo”: {
“EnShortDesc”: “Mobile Number”,
“ArShortDesc”: “رقم الموبايل”,
“EnDesc”: “Mobile Number”,
“ArDesc”: “رقم الموبايل”
}
},
{
“ServiceInfo”: {
“Code”: “20168”,
“Type”: “Lords_mobile”,
“EnShortDesc”: “Lords mobile”,
“ArShortDesc”: “لورد موبايل”,
“EnDesc”: “Lords mobile”,
“ArDesc”: “لورد موبايل”,
“PaymentType”: “Prepaid”,
“BillingNoRequired”: “true”,
“ContainsPrepaidCats”: “false”,
“Currency”: “USD”
},
“BillingInfo”: {
“EnShortDesc”: “Mobile Number”,
“ArShortDesc”: “رقم الموبايل”,
“EnDesc”: “Mobile Number”,
“ArDesc”: “رقم الموبايل”,
“Regex”: “^(9705|9725)\d{8}$”
}
},
{
“ServiceInfo”: {
“Code”: “20169”,
“Type”: “mobile_legends”,
“EnShortDesc”: “mobile legends”,
“ArShortDesc”: “موبايل ليجندس”,
“EnDesc”: “mobile legends”,
“ArDesc”: “موبايل ليجندس”,
“PaymentType”: “Prepaid”,
“BillingNoRequired”: “true”,
“ContainsPrepaidCats”: “false”,
“Currency”: “USD”
},
“BillingInfo”: {
“EnShortDesc”: “Mobile Number”,
“ArShortDesc”: “رقم الموبايل”,
“EnDesc”: “Mobile Number”,
“ArDesc”: “رقم الموبايل”,
“Regex”: “^(9705|9725)\d{8}$”
}
},
{
“ServiceInfo”: {
“Code”: “20170”,
“Type”: “FreeFire”,
“EnShortDesc”: “FreeFire”,
“ArShortDesc”: “فريفاير”,
“EnDesc”: “FreeFire”,
“ArDesc”: “فريفاير”,
“PaymentType”: “Prepaid”,
“BillingNoRequired”: “true”,
“ContainsPrepaidCats”: “true”,
“Currency”: “USD”
},
“BillingInfo”: {
“EnShortDesc”: “Mobile Number”,
“ArShortDesc”: “رقم الموبايل”,
“EnDesc”: “Mobile Number”,
“ArDesc”: “رقم الموبايل”
},
“PrepaidCategories”: {
“PrepaidCatInfo”: [
{
“Code”: “26”,
“Type”: “FreeFire_100_Diamo”,
“EnShortDesc”: “FreeFire 100 Diamo”,
“ArShortDesc”: "فريفاير 100 دايموند ",
“EnDesc”: “FreeFire 100 Diamo”,
“ArDesc”: "فريفاير 100 دايموند "
},
{
“Code”: “25”,
“Type”: “FreeFire_210_Diamo”,
“EnShortDesc”: “FreeFire_210_Diamo”,
“ArShortDesc”: "فريفاير 210 دايموند ",
“EnDesc”: “FreeFire 210 Diamo”,
“ArDesc”: "فريفاير 210 دايموند "
},
{
“Code”: “41”,
“Type”: “FreeFire_530_Diamo”,
“EnShortDesc”: “FreeFire 530 Diamo”,
“ArShortDesc”: “فريفاير 530 دايموند”,
“EnDesc”: “FreeFire 530 Diamo”,
“ArDesc”: “فريفاير 530 دايموند”
}
]
}
}

I’m sorry but I really can’t follow. In particular there is ambiguity for me in “However, when I moved the code to Software AG and converted it to JSON, then passed it to a Java service, a field went missing, and the data stored in the database was incorrect.”

Can you be more specific?

1 Like

Hi,

I agree with Christoph.

Esp. a screenshot of the generated JSON DocType would be helpful, as well as the name of the field you are missing between input and output.

Regards,
Holger

1 Like