Page 1 of 1

LANSA Integrator - How to pass large base64 value

Posted: Tue Oct 30, 2018 6:52 pm
by nick.diama
Hi all,

In order for Integrator to pass a value from a LANSA field to an entity defined either in an xml or json structure, that entity must be mapped to the corresponding LANSA field via LANSA Integrator Studio.

The problem that I am facing is the following. I have a large pdf that I must convert it to base64 and then map it to an xml entity.
Since the pdf is very large, defining a string field that will hold the base64 value of the pdf won't work as the base64 value of the pdf is almost 900000 characters.

So I decided to define inline a PRIM_DC.UniCodeString (Define_Com Class(#PRIM_DC.UnicodeString) Name(#CONTENT)) in order to pass to it the base64 value. The name of the defined PRIM_DC.UniCodeString (CONTENT) was used in the Integrator solution as a map to the xml entity.

It seems however that Integrator maps only defined fields (e.g. Define Field(#METADTA) Type(*STRING) Length(65535)). One solution that is provided is available only to soap solutions with the use of a "stream file" declaration.

So, my question is. How Can I pass to json or xml entities large base64 values? How can Integrator understand defined classes of PRIM_DC.UniCodeString in order to map them in json or xml entities?

Thanks in advance for your answers.

Regards,
Nick

Re: LANSA Integrator - How to pass large base64 value

Posted: Tue Feb 05, 2019 10:23 pm
by nick.diama
Hi all,

Can also JSON Binding Wizard accept Base64?

Regards,
Nick

Re: LANSA Integrator - How to pass large base64 value

Posted: Tue Feb 05, 2019 11:20 pm
by René Houba
Hi Nick,

Integrator support a data type binary based 64 file:
Data Type binary based64 file (1).JPG
Data Type binary based64 file (1).JPG (63.77 KiB) Viewed 18350 times
Data Type binary based64 file (2).JPG
Data Type binary based64 file (2).JPG (25.25 KiB) Viewed 18350 times

Re: LANSA Integrator - How to pass large base64 value

Posted: Tue Feb 05, 2019 11:24 pm
by nick.diama
Hi Rene,
But this option is not available in JSON Binding Wizard, correct?
Is there a chance to have JSON Binding Wizard supporting output to base64 binary file?
Regards,
Nick

Re: LANSA Integrator - How to pass large base64 value

Posted: Tue Feb 05, 2019 11:34 pm
by René Houba
Hi Nick,

You could be rigth about that. I will check.

In the meantime, this visual LANSA forum contains something for enhancement request:
Suggestions for Product Enhancements

Please put this as an enhancement in there!


Kind regards,
René

Re: LANSA Integrator - How to pass large base64 value

Posted: Wed Feb 06, 2019 3:13 am
by caseywhite
In JSON use a String data type but map that data type to a BLOB field. It will handle the base64 encoding automatically.

Re: LANSA Integrator - How to pass large base64 value

Posted: Wed Feb 06, 2019 6:09 am
by nick.diama
Hi Casey,
I defined a BLOB field, as a repository field. In my function it is mentioned in a Group_By. However, the Integrator trace reports the following.

Command : GET SERVICE_EXCHANGE(*FIELD) FRAGMENT(PHOTO)
Current fragment is PHOTO
Bind fragment member field count : 2
Function does not contain field : CONTENT
[TYPE][idFaceToFaceProof]
Command : OK ""

Any comments?
Regards,
Nick

Re: LANSA Integrator - How to pass large base64 value

Posted: Wed Feb 06, 2019 6:54 am
by caseywhite
You SERVICE_EXCHANGE needs to be *FIELDS. *FIELDS includes additional data types like BLOB. *FIELD does not.

Re: LANSA Integrator - How to pass large base64 value

Posted: Sat Feb 16, 2019 1:01 am
by nick.diama
Hi Casey,
Thanks for all the help. Much apreciated!
Regards,
Nick

Re: LANSA Integrator - How to pass large base64 value

Posted: Sat Feb 16, 2019 3:11 am
by caseywhite
Have you verified that the .properties file contains an entry for CDRQ. There should be more info in the SERVICE.TXT file or the TRANSPORT.TXT file. You should attach all files that are in the trace directory. Also, are you sure that is the correct trace? The only reason I ask is the TRACE_NAME is quite long and I don't see a TRACE_NAME on the code you posted.