I'm wondering if anyone has done something like this with YAJL? I return an array of data from the browser which contains an array. Maybe it will make better sense visually? Our freight provider will use this tool to build shipments. Each row is a product and will have one or many pallets associated with it.
The data is sent to my RPG program like below. At this point I'm able to get into the lineItems array no problem. It's when I then try to get the dims. While in the YAJL_OBJECT_LOOP I hit they dims key, but that's not really what I want. I've tried YAJL_OBJECT_FIND to look for dims, but that returns null. If I need to, I can re-work this to send a lineItems array and dims array separately, but I wouldn't mind getting this working!
JSON snippet, if that helps:
Thanks in advance.
Mike
The data is sent to my RPG program like below. At this point I'm able to get into the lineItems array no problem. It's when I then try to get the dims. While in the YAJL_OBJECT_LOOP I hit they dims key, but that's not really what I want. I've tried YAJL_OBJECT_FIND to look for dims, but that returns null. If I need to, I can re-work this to send a lineItems array and dims array separately, but I wouldn't mind getting this working!
JSON snippet, if that helps:
Code:
{ "shipment": { "action": "Save", "businessUnit": "xxxxxxxxxxxxxxxx", "mode": "LTL", "lineItems": [{ "oloqty": 1, "pgdesc": "SUPER BIKE 2 42\" DELUXE", "pgprdc": "BETM 024713N", "ptdesc": "SB2-42\" (DLX)", "ptinmt": "BETM 024713N", "ptoutm": "SB2-42\" (DLX)", "ptqtye": 1, "weight": 1657, "dims": [{ "ptnwgt": 412, "ptgvol": 0, "pthigh": 84, "ptleng": 48, "pttvoc": "", "ptwidt": 36, "ptqtye": 1 }, { "ptnwgt": 245, "ptgvol": 0, "pthigh": 48, "ptleng": 38, "pttvoc": "", "ptwidt": 69, "ptqtye": 1 }, { "ptnwgt": 1000, "ptgvol": 0, "pthigh": 48, "ptleng": 48, "pttvoc": "", "ptwidt": 48, "ptqtye": 1 }] }, { "oloqty": 1, "pgdesc": "SNO CROSS 42\" DELUXE", "pgprdc": "BETM 025401N", "ptdesc": "SNO-X - 42\" (DELUXE)", "ptinmt": "BETM 025401N", "ptoutm": "SNO-X - 42\" (DELUXE)", "ptqtye": 1, "weight": 585, "dims": [{ "ptnwgt": 368, "ptgvol": 0, "pthigh": 70, "ptleng": 46, "pttvoc": "", "ptwidt": 32, "ptqtye": 1 }, { "ptnwgt": 217, "ptgvol": 0, "pthigh": 42, "ptleng": 38, "pttvoc": "", "ptwidt": 69, "ptqtye": 1 }] }, { "oloqty": 1, "pgdesc": "BBHD 80\" MONITOR STAND", "pgprdc": "BETM 025432N", "ptdesc": "80\" STAND", "ptinmt": "BETM 025432N", "ptoutm": "80\" STAND", "ptqtye": 0, "weight": 155, "dims": [{ "ptnwgt": 155, "ptgvol": 0, "pthigh": 56, "ptleng": 44, "pttvoc": "", "ptwidt": 35, "ptqtye": 0 }] }, { "oloqty": 1, "pgdesc": "ALIENS ARMAGEDDON 55\" DX", "pgprdc": "BETM 025765N", "ptdesc": "ALIENS 55 DESCRIPTION", "ptinmt": "BETM 025765N", "ptoutm": "ALIENS 55\"", "ptqtye": 1, "weight": 485, "dims": [{ "ptnwgt": 485, "ptgvol": 0, "pthigh": 96, "ptleng": 48, "pttvoc": "", "ptwidt": 48, "ptqtye": 1 }] }] } }
Mike
Comment