Hello
I send a list of integers to a webservice, when this list exceeds a lengt I get the 404 error in the jobDone
If in the list jsonBuilder.Append removed the last record, it works fine and I download the images in base64 What could be the problem?
Thank you.
I send a list of integers to a webservice, when this list exceeds a lengt I get the 404 error in the jobDone
B4X:
Sub BSendIdHisDoc
Dim map As Map
Dim llista As List
map.Initialize
llista.Initialize
llista.Clear
llista = DBUtils.ExecuteMemoryTable(Main.SQL,"SELECT DISTINCT id_mnt_punto FROM his_mnt_operacion_punto WHERE id_mnt_punto <> 0",Null,0)
'llista = DBUtils.ExecuteMemoryTable(Main.SQL,"SELECT DISTINCT id_mnt_punto FROM his_mnt_operacion_punto WHERE id_mnt_punto = 10868",Null,0)
Dim llistaIds As List
llistaIds.Initialize
Dim ids As List
ids.Initialize
Dim jsonBuilder As StringBuilder
jsonBuilder.Initialize()
'
' jsonBuilder.Append("[")
' For i=0 To llista.Size-1
' ids.Add(llista.Get(i))
' map = CreateMap("IDHisDoc": Null)
'
' Dim str(0) As String = llista.Get(i)
' jsonBuilder.Append("{""IDHisDoc"":").Append("""" & str(0) & """").Append("},")
' Next
'
' jsonBuilder.Append("]")
jsonBuilder.Append("[{""IDHisDoc"":""27740""}, {""IDHisDoc"":""27739""}, {""IDHisDoc"":""20244""}, {""IDHisDoc"":""29386""}, {""IDHisDoc"":""16035""}, {""IDHisDoc"":""6322""}, {""IDHisDoc"":""28624""}, {""IDHisDoc"":""10958""}, {""IDHisDoc"":""21074""}, {""IDHisDoc"":""682""}, {""IDHisDoc"":""21045""}, {""IDHisDoc"":""29343""}, {""IDHisDoc"":""10868""}, {""IDHisDoc"":""6323""}, {""IDHisDoc"":""10869""}, {""IDHisDoc"":""1772""}, {""IDHisDoc"":""683""}, {""IDHisDoc"":""16037""}, {""IDHisDoc"":""21071""}, {""IDHisDoc"":""22590""}, {""IDHisDoc"":""29344""}, {""IDHisDoc"":""28625""}, {""IDHisDoc"":""5613""}, {""IDHisDoc"":""6324""}, {""IDHisDoc"":""29345""}, {""IDHisDoc"":""16038""}, {""IDHisDoc"":""22589""}, {""IDHisDoc"":""684""}, {""IDHisDoc"":""28626""}, {""IDHisDoc"":""21073""}, {""IDHisDoc"":""29374""}, {""IDHisDoc"":""5614""}, {""IDHisDoc"":""6325""}, {""IDHisDoc"":""10950""}, {""IDHisDoc"":""5615""}, {""IDHisDoc"":""21075""}, {""IDHisDoc"":""29346""}, {""IDHisDoc"":""16043""}, {""IDHisDoc"":""28627""}, {""IDHisDoc"":""554""}, {""IDHisDoc"":""6326""}, {""IDHisDoc"":""5616""}, {""IDHisDoc"":""28628""}, {""IDHisDoc"":""29347""}, {""IDHisDoc"":""10956""}, {""IDHisDoc"":""7827""}, {""IDHisDoc"":""21076""}, {""IDHisDoc"":""16044""}, {""IDHisDoc"":""6327""}, {""IDHisDoc"":""28629""}, {""IDHisDoc"":""10952""}, {""IDHisDoc"":""16046""}, {""IDHisDoc"":""29348""}, {""IDHisDoc"":""21077""}, {""IDHisDoc"":""2368""}]")
' Dim json As JSONGenerator
' json.Initialize2(llistaIds)
' json.ToString
jsonBuilder.ToString
Log(jsonBuilder.ToString)
If Codi.CheckWiFi(True) Then
Dim job As HttpJob
job.Initialize("getImagePoint", Me)
job.Download2(Main.webserver&"/ws.asmx/getImagePoint", Array As String("jSonPoints", jsonBuilder.ToString))
job.GetRequest.TimeOut = 5000
Else
' Error si no hi ha connexió
ToastMessageShow("Error descargar imagenes", True)
Sleep(3000)
End If
End Sub
B4X:
Sub JobDone (job As HttpJob)
'If job.Success Then
Try
' Obtenim les fotos dels punts d'inspecció
Dim jsonParser As JSONParser
jsonParser.Initialize(job.GetString)
' Dim mResponse As Map
' mResponse.Initialize
'If mResponse.IsInitialized Then
'mResponse = jsonParser.NextArray
Main.SQL.ExecNonQuery("DELETE FROM cus_guardar_imatges")
Dim quotes As List = jsonParser.NextArray
'For Each quot As Map In quotes
DBUtils.InsertMaps(Main.SQL, "cus_guardar_imatges", quotes, False)
Log("DOWNLOAD IMAGES SUCCESS")
'Next
'End If
Catch
Log(LastException)
End Try
'End If
job.Release
ProgressDialogHide
End Sub
If in the list jsonBuilder.Append removed the last record, it works fine and I download the images in base64 What could be the problem?
Thank you.