[ardoHTTP] HTTPGet response getting trimmed?

[ardoHTTP] HTTPGet response getting trimmed?

  
Forge Component
(16)
Published on 2015-06-04 by Ricardo Silva
16 votes
Published on 2015-06-04 by Ricardo Silva

Hi,

I am calling a service that returns a JSON using ardoHTTP. When I check the response I see that not the whole response string is displayed (during debug). I see 5004 characters in the HTTPGet.Response variable.

I need response data which could be about 4 times of that size, like 20K characters.

How do I get it?

Thanks. 

Hi Goldy,

The debugger doesn't always display everything, especially large values are being truncated. Is it just during debugging that you experience this, or is there actually too little content being received?

Hi Goldy,

During debug time, you cannot see all the data if it is more than some defined length (I don't remember length) but if you wish, you can assign that data to some local variable and use one temporary expression to show the result of that local variable on page.

Thank you Kilian, Suraj.

"Is it just during debugging that you experience this, or is there actually too little content being received?"
This e-Space and Action is not part of a direct UI interaction. I can try to check if an expression is printing everything or not.

 you can assign that data to some local variable 
I am using Substring on the return data. When I try to Substring the data within this 5004 chars, it works, but for other data it does not. So, I assume it answers this question indirectly, yeah?

I looked at the code inside the extension (see snippet) and i dont find anything wrong.

Which means, there is some practical limit to the text datatype in outsystems, or so, it appears.

Documentation does not say much about it either https://success.outsystems.com/Documentation/10/Reference/Data/Data_Types/Available_Data_Types

Solution

I just tested this with an espace that downloads Jane Austen's Pride and Prejudice ( 700k bytes) and the text has 700k bytes, counted using Length.


Seems there is no limitation either on the text datatype or ardoHTTP.


Are you absolutely sure your problem isn't just on the debugger?

Solution

Goldy,

Besides the fact that Debug can limit the characters (in visualization), there are no "limitation" in data types in OutSystems than those of the Database you are using.

But there are some things you need to pay attention.

For example, if you create (and publish) an entity that will store a text of less than 2000 characters in length, OutSystems will use a certain data type. If the length defined in the field at the time of the first publishing is bigger than that, it will use another data type.

The problem arises when you try to change the length to more than 2000 characters AFTER having published with less. In this case, you will be limited to the 2000 characters as the type will not be changed (as far as I remember).

You can see the database data types here: https://success.outsystems.com/Documentation/10/Reference/Data/Database_Reference/Database_Data_Types

Another problem can happen if you changed the size of a field in an entity in an espace, but didn't refresh the reference in the espace that is using it.

And, of course, if the data is REALLY being "cut", like, you are expecting and the result SHOULD be like 10K characters and you are receiving 5K (assuming you can store the info and check that it is not only a debug visualization truncate), maybe is a problem at the other end?

Cheers,
Eduardo Jauch

Thank you @Eduardo, there is No database or entity attribute in this situation.

@Ricardo, Thank you very much. I found the culprit. It was in front of my screen. The substr function had a extra character that was causing it :-( 


Thank you everyone for your timely responses in helping. Really appreciate.