#XPRIM_HttpRequest & Base64
Posted: Mon Sep 10, 2018 11:10 am
I am trying to send a file in a json object using the following code
Define_Com Class(#XPRIM_Binary) Name(#MyFileBinary)
#MyFileBinary.FromFile Path(#ifslnm)
.
.
.
#RootObject.InsertString Key('project') String(#MyFileBinary.AsBase64String)
#Request.Content.AddJsonObject( #RootObject )
#Request.DoPOst( #urlX )
While this runs fine for smaller files I tried it with a 16meg PDF and received the following error
LANSA REQUEST(X_RUN) PROCESS(MCAT001) FUNCTION(GCAT0Y7) PARTITION(V40) X
RUNADPRM('DBUG=Y DBHT=lcb1059:51234')
Fatal Error:
Fatal Error : Component : XLB00046 (Internal) Reference to C++ peer
obj Statement : 124 Message : bad allocation Routine : *COMP.
Is there some underlying maximum size for the json object or a component of it.
It seems to be legitimate as json and http and in fact works fine with Lansa Integrator.
Define_Com Class(#XPRIM_Binary) Name(#MyFileBinary)
#MyFileBinary.FromFile Path(#ifslnm)
.
.
.
#RootObject.InsertString Key('project') String(#MyFileBinary.AsBase64String)
#Request.Content.AddJsonObject( #RootObject )
#Request.DoPOst( #urlX )
While this runs fine for smaller files I tried it with a 16meg PDF and received the following error
LANSA REQUEST(X_RUN) PROCESS(MCAT001) FUNCTION(GCAT0Y7) PARTITION(V40) X
RUNADPRM('DBUG=Y DBHT=lcb1059:51234')
Fatal Error:
Fatal Error : Component : XLB00046 (Internal) Reference to C++ peer
obj Statement : 124 Message : bad allocation Routine : *COMP.
Is there some underlying maximum size for the json object or a component of it.
It seems to be legitimate as json and http and in fact works fine with Lansa Integrator.