Is there a limit to how many bytes that can be received from a Web Service?

GlenAlan

Member
Licensed User
Longtime User
I have a web service that sometimes returns more than 4000 bytes of data in a JSON string.

Using the "GetString(URL)" function in HttpUtils, the data received in the response string has been truncated at around 4090 bytes?

I have tested the response from the web service using other software and it is definitely returning the correct amount of data.

Is there an Android setting somewhere that limits the amount of data that is received and, if so, how do I increase this limit?

UPDATE: Sorry, because of the limit of about 4000 characters per line in the Log window, it looked like the Response string was truncated.

The actual error happens when trying to extract the 101st element of the List created from the JSON string. In the following Code, when reaches 101, this error occurs: AccNo= m.Get("AccNo"): java.lang.RuntimeException: Object should first be initialized (Map).

The Main.QueryList.Size is 182.

For i = 0 To Main.QueryList.Size - 1
Dim m As Map
m = Main.QueryList.Get(i)
AccNo= m.Get("AccNo")
AccName= m.Get("Name")
Balance= NumberFormat2(m.Get("Balance"), 0, 2, 2, True)
Table1.AddRow(Array As String(AccNo,AccName,Balance))
Next
 
Last edited:

GlenAlan

Member
Licensed User
Longtime User
Ok. Found the problem.

It turns out that, although the web service is returning a JSON string with 180 rows, rows 101 to 180 are NULLS (bug in the web service code).

Although the Nulls are correctly parsed by b4a's JSON parser and placed in the List, the extraction of Null elements from the List to a Map causes this error. Unfortunately, the error explanation mislead me and confused the issue.
 
Top