LANSA Integrator - How to pass large base64 value
-
nick.diama
- Posts: 19
- Joined: Wed May 25, 2016 5:36 pm
LANSA Integrator - How to pass large base64 value
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
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
Hi all,
Can also JSON Binding Wizard accept Base64?
Regards,
Nick
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
Hi Nick,
Integrator support a data type binary based 64 file:
Integrator support a data type binary based 64 file:
-
nick.diama
- Posts: 19
- Joined: Wed May 25, 2016 5:36 pm
Re: LANSA Integrator - How to pass large base64 value
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
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
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é
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
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
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
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
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
Hi Casey,
Thanks for all the help. Much apreciated!
Regards,
Nick
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
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.