LANSA Integrator - How to pass large base64 value

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
nick.diama
Posts: 19
Joined: Wed May 25, 2016 5:36 pm

LANSA Integrator - How to pass large base64 value

Post 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
nick.diama
Posts: 19
Joined: Wed May 25, 2016 5:36 pm

Re: LANSA Integrator - How to pass large base64 value

Post by nick.diama »

Hi all,

Can also JSON Binding Wizard accept Base64?

Regards,
Nick
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Re: LANSA Integrator - How to pass large base64 value

Post 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 18355 times
Data Type binary based64 file (2).JPG
Data Type binary based64 file (2).JPG (25.25 KiB) Viewed 18355 times
nick.diama
Posts: 19
Joined: Wed May 25, 2016 5:36 pm

Re: LANSA Integrator - How to pass large base64 value

Post 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
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Re: LANSA Integrator - How to pass large base64 value

Post 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é
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Re: LANSA Integrator - How to pass large base64 value

Post 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.
nick.diama
Posts: 19
Joined: Wed May 25, 2016 5:36 pm

Re: LANSA Integrator - How to pass large base64 value

Post 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
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Re: LANSA Integrator - How to pass large base64 value

Post by caseywhite »

You SERVICE_EXCHANGE needs to be *FIELDS. *FIELDS includes additional data types like BLOB. *FIELD does not.
nick.diama
Posts: 19
Joined: Wed May 25, 2016 5:36 pm

Re: LANSA Integrator - How to pass large base64 value

Post by nick.diama »

Hi Casey,
Thanks for all the help. Much apreciated!
Regards,
Nick
Last edited by nick.diama on Thu Feb 21, 2019 9:04 pm, edited 1 time in total.
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Re: LANSA Integrator - How to pass large base64 value

Post 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.
Post Reply