NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on August 28, 2017, 05:33:32 AM
-
Hi,
I've been struggling with a web service method when inserting a record - it keeps on saying the record field values are blank. I've traced it down to (what I think) a problem on how the JSON class parses a string.
Attached is a small example app, showing that the JSON string contains a valid object, but when parsed it only has blank values. The code in the app is mostly copied from the generated template code, that is found in the PrimeParameters routine.
Can this be a problem in the JSON class, or do I have to change settings in the web service method? I'm using jFiles version 1.48.
Thanks
Thys
-
...sorry, the attachment!
-
Thys - not sure if this is related to your problem or not, but grab jFiles 1.51 and retest with that please.
Cheers
Bruce
-
Bruce,
I already had 1.50 installed, and with 1.51 the JSON is still not properly parsed. I probably need to look at how the JSON is presented. Here is the specific object that I can't get parsed. Maybe you can spot the problem in the structure right away?
{
"SessionGUID":"E7SGN6Q0EPMVOFKX",
"MedicalAidDependant":[
{
"GUID":null,
"MedicalAidMembershipGUID":"69I87A8NTJ3XUUQG",
"PersonGUID":null,
"Name":"Jon-jon"
}
]
}
Thanks
Thys
-
You are setting Case to "As Is" (which is correct since the incoming JSON names have mixed case).
BUT your Queue declaration has no External names set. So all the field names are uppercase. (In Clarion, if External Name is not set, the the Label is used, but Labels are always uppercase since Clarion is a Case-Insensitive language.)
cheers
Bruce
-
I knew that the JSON case will some day cause me some measure of embarrassment...
Thanks Bruce.