R: Re-2: O$8.0.3.2 OJSON.$listorrowtojson() – impairs speed
Thanks Lars,
I added a workaround to fix this ‘probably’ bug in the $listorrowtojson()
method.
______________
Do OJSON.$listorrowtojson(RecJsonHEADER,kUniTypeCharacter,Message) Returns
JsonCHARsField
;… preparing and fixing the rows-part, and finally…
; Convert it to UTF8
Calculate JsonBinaryField as chartoutf8(JsonCHARsField)
…
Do $cinst.$init(iURL,kOWEBhttpMethodPost,iHeadersList,JsonBinaryField)
Do $cinst.$run() Returns Retc
______________
Bye
Rocco
_________________________________
Distinti saluti. Best regards.
Rocco Dr. Ventura
WMS Analist and Software Developer
KUNVI srl – Experiences Holding – www.kunvi.it
Email: r.ventura@kunvi.it – Mobile: +39 348 5186051
—–Messaggio originale—–
Da: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] Per conto
di Lars Schärer
Inviato: sabato 29 luglio 2017 10:26
A: omnisdev-en@lists.omnis-dev.com
Oggetto: Re-2: O$8.0.3.2 OJSON.$listorrowtojson() – impairs speed
imho it is a waste to transfer the definitions of each (empty) field of EACH
row for lists placed into rows.
but i understood this is not a bug, but pure json?
if you use the schemas in the jsclient, what will work is
> {OrderNumber: krsTestOrd9?,CartonNumber: 17FX0000027?,
> PackageType: PVS-P-001?,PackingList: [{VariantCode:
> 701644026622,PackedQty: 1}]}
but not (without some minimal additional code)
> {OrderNumber:P00001005?,CartonNumber:17FX0000029?,
> PackageType:PVS-P-001?,PackingList:[[8300896432544,1]]}
my workaround is to define PackingList as Charakter
and to use the Backend to produce the JSON (Or my own function to produce
the delimited text 8300896432544,1 ],[ 8300896432545,2 ],[
8300896432546,3
would be great to have a choice
and save a lot of traffic if omnis would use the shorter syntax internally
will result in a LOT MORE SPEED in many situations.
LArs
processed by David.fx
Subject: Re: O$8.0.3.2 OJSON.$listorrowtojson() (29-Jul-2017 5:25)
From: Vik Shah
To: omnisdev-en@lists.omnis-dev.com
yes I can confirm that that is the behaviour and I think I reported this a
while back, cant recall now.
IMHO its a bug.
> On 28 Jul 2017, at 23:49, Rocco Ventura [Kunvi] wrote:
>
> Hi to all,
>
> Im using a JSON call to a customer-server and following the documentaion
> Ive preparared the Json structure using the static method
> OJSON.$listorrowtojson(), but it seems there is a bug in the result.
>
> The structure to send is formed by a header and a list-of-rows, so I
defined
> a schema for the header and in the last field of it I added a List-field
of
> Omnis: here is the header-schema:
>
> HEADER SCHEMA
> 1) OrderNumber, Character 100
> 2) CartonNumber, Character 100
> 3) PackageType, Character 10
> 4) PickingList, List, subtype=sx_rows_schema
>
> ROWS-SCHEMA: sx_rows_schema
> 1) VariantCode, Char 100
> 2) PackadQty, Integer 32bit
>
> So, in the Omnin-code I prepare the data and finally I call
> OJSON.$listorrowtojson() but I obtain a structure like the follow
>
> {OrderNumber:P00001005?,CartonNumber:17FX0000029?,
> PackageType:PVS-P-001?,PackingList:[[8300896432544,1]]}
>
> Instead of this
where there are the fied-name of the rows.
>
> {OrderNumber: krsTestOrd9?,CartonNumber: 17FX0000027?,
> PackageType: PVS-P-001?,PackingList: [{VariantCode:
> 701644026622,PackedQty: 1}]}
>
> Do you think there is a bug in OJSON.$listorrowtojson() or I missed
> something!?
>
> Thanks
>
> Bye
>
> Rocco
>
> _________________________________
> Distinti saluti. Best regards.
>
> Rocco Dr. Ventura
> WMS Analist and Software Developer
>
> KUNVI srl – Experiences Holding – www.kunvi.it
> Email: r.ventura@kunvi.it – Mobile: +39 348 5186051
>
>
>
> —
> Questa e-mail e stata controllata per individuare virus con Avast
antivirus.
> www.avast.com/antivirus
>
>
> _____________________________________________________________
> Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com
—
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
www.avast.com/antivirus
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com