Web API - XPRIM_RandomAccessJsonReader - Size Limit?
Posted: Tue Sep 06, 2022 1:06 am
Hi,
I use XPRIM_RandomAccessJsonReader for working with HTTP request responses.
Definition: Define_Com Class(#XPRIM_RandomAccessJsonReader) Name(#Reader)
Receiving the HTTP response: #Reader.SetSourceString String(#HTTP_Request.Response.AsString) Errorinfo(#ErrorInfo)
I have to work with responses that are quite large - CurSizes of #HTTP_Request.Response.AsString can be more than 200000.
I have the feeling that the Reader cannot save so many characters. Is this correct? Is there a limit to 65555?
When I receive requests that are of CurSize = 40000 e.g. the commands
#STD_NUM := #Reader.ReadNumberWithName( "total" )
#Reader.BeginArrayWithName( "data" )
#Reader.BeginObjectAtIndex( 1 )
#STD_TEXT := #Reader.ReadStringWithName( "orderNumber" ).AsNativeString
#STD_TEXTL := #Reader.ReadStringWithName( "currencyId" ).AsNativeString
retrieve the correct values that I can see in my response.body.log file.
When CurSize is much bigger these commands retrieve no values at all (I suppose because the end of the array structure and other values are not integrated in the string that the reader contains).
How do you handle big amounts of response data in your web APIs?
Kind regards,
Joerg
I use XPRIM_RandomAccessJsonReader for working with HTTP request responses.
Definition: Define_Com Class(#XPRIM_RandomAccessJsonReader) Name(#Reader)
Receiving the HTTP response: #Reader.SetSourceString String(#HTTP_Request.Response.AsString) Errorinfo(#ErrorInfo)
I have to work with responses that are quite large - CurSizes of #HTTP_Request.Response.AsString can be more than 200000.
I have the feeling that the Reader cannot save so many characters. Is this correct? Is there a limit to 65555?
When I receive requests that are of CurSize = 40000 e.g. the commands
#STD_NUM := #Reader.ReadNumberWithName( "total" )
#Reader.BeginArrayWithName( "data" )
#Reader.BeginObjectAtIndex( 1 )
#STD_TEXT := #Reader.ReadStringWithName( "orderNumber" ).AsNativeString
#STD_TEXTL := #Reader.ReadStringWithName( "currencyId" ).AsNativeString
retrieve the correct values that I can see in my response.body.log file.
When CurSize is much bigger these commands retrieve no values at all (I suppose because the end of the array structure and other values are not integrated in the string that the reader contains).
How do you handle big amounts of response data in your web APIs?
Kind regards,
Joerg