Hi all,
I was using earlier HttpUtils and job3 where i am fetching data from server, which was working well.
Now in my project i am Using enhanced version off HttpUtils2 where I could use the below code, it is going to Job3 but response string JSON getting error, Please advice..
At
'response = HttpUtils.GetString(ServerUrl) 'Previous version which is is working well
response = htjob3.GetString2(ServerUrl) 'new HttpUtils2 facing problem
Sub JobDone (Job As HttpJob)
Try
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1"
'print the result to the logs
ToastMessageShow("Sucess", True)
Case "Job2"
'Msgbox("test9","log")
'print the result to the logs
' myABbarcode.ABGetBarcode("myabbarcode", "")
phBool=True
ToastMessageShow("Sucess", True)
Case "Job3"
'print the result to the logs
' ToastMessageShow("Sucess", True)
Msgbox("JobProgress","test")
Dim parser As JSONParser
Dim response As String
'response = HttpUtils.GetString(ServerUrl)
response = htjob3.GetString2(ServerUrl)
parser.Initialize(response)
Dim rows As List
rows = parser.NextArray
Msgbox(rows.Size,"test")
For i = 0 To rows.Size - 1
Log("Rows #" & i)
Dim m As Map
m = rows.Get(i)
Log("col1=" & m.Get("col1")) 'log the values of col1 and col2
Log("col2=" & m.Get("col2"))
Msgbox(m.Get("ATTRIBUTE1"),"test")
Msgbox(m.Get("ATTRIBUTE1"),"test1")
Next
Case "Job4"
'print the result to the logs
ToastMessageShow("Sucess", True)
Case "Job5"
'print the result to the logs
ToastMessageShow("Sucess", True)
Case "Job6"
'print the result to the logs
ToastMessageShow("Sucess", True)
End Select
Else
' Log("Error: " & Job.ErrorMessage)
' Msgbox("Error: " & Job.ErrorMessage,"error")
ToastMessageShow("Error" , True)
esq1="INSERT INTO Error_Table VALUES(" & """" & trstr & """" &")"
sql1.ExecNonQuery(esq1)
End If
Job.Release
Catch
Log(LastException.Message)
End Try
End Sub
I was using earlier HttpUtils and job3 where i am fetching data from server, which was working well.
Now in my project i am Using enhanced version off HttpUtils2 where I could use the below code, it is going to Job3 but response string JSON getting error, Please advice..
At
'response = HttpUtils.GetString(ServerUrl) 'Previous version which is is working well
response = htjob3.GetString2(ServerUrl) 'new HttpUtils2 facing problem
Sub JobDone (Job As HttpJob)
Try
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1"
'print the result to the logs
ToastMessageShow("Sucess", True)
Case "Job2"
'Msgbox("test9","log")
'print the result to the logs
' myABbarcode.ABGetBarcode("myabbarcode", "")
phBool=True
ToastMessageShow("Sucess", True)
Case "Job3"
'print the result to the logs
' ToastMessageShow("Sucess", True)
Msgbox("JobProgress","test")
Dim parser As JSONParser
Dim response As String
'response = HttpUtils.GetString(ServerUrl)
response = htjob3.GetString2(ServerUrl)
parser.Initialize(response)
Dim rows As List
rows = parser.NextArray
Msgbox(rows.Size,"test")
For i = 0 To rows.Size - 1
Log("Rows #" & i)
Dim m As Map
m = rows.Get(i)
Log("col1=" & m.Get("col1")) 'log the values of col1 and col2
Log("col2=" & m.Get("col2"))
Msgbox(m.Get("ATTRIBUTE1"),"test")
Msgbox(m.Get("ATTRIBUTE1"),"test1")
Next
Case "Job4"
'print the result to the logs
ToastMessageShow("Sucess", True)
Case "Job5"
'print the result to the logs
ToastMessageShow("Sucess", True)
Case "Job6"
'print the result to the logs
ToastMessageShow("Sucess", True)
End Select
Else
' Log("Error: " & Job.ErrorMessage)
' Msgbox("Error: " & Job.ErrorMessage,"error")
ToastMessageShow("Error" , True)
esq1="INSERT INTO Error_Table VALUES(" & """" & trstr & """" &")"
sql1.ExecNonQuery(esq1)
End If
Job.Release
Catch
Log(LastException.Message)
End Try
End Sub