Hello Sir,
When I connect my app with 'ashx' web service using OkHttpUtils2 then I receive only json string.
My code
MainActivity
Web service code:
My Output
[{"Date":"02-03-2015","VchNo":" 43","VchType":"Production","Details":"","Status":"SS 14 ; USB (RED) ; GLOBAL","Dev_Warranty":"01-03-2016","Narration":""},{"Date":"30-03-2015","VchNo":" 4526","VchType":"Dispatch","Details":"KGSS","Status":"SS 14 ; USB (RED) ; GLOBAL","Dev_Warranty":"02-04-2016","Narration":""},{"Date":"29-02-2016","VchNo":" ","VchType":"Upgrd. Version","Details":"14 to 16 ; KGSS ( BUC Consumed : 2 / INR 1600 )","Status":"SS 16 ; USB (RED) ; GLOBAL","Dev_Warranty":"02-04-2016","Narration":""},{"Date":"01-03-2016","VchNo":" ","VchType":"Installation","Details":"WMMC INDIA","Status":"SS 16 ; USB (RED) ; GLOBAL","Dev_Warranty":"28-02-2017","Narration":""},{"Date":"15-05-2017","VchNo":"","VchType":"Upgrd. Composite","Details":"SS 16 to SS 17 ; KGSS ( BUC Consumed : 3 / INR 2400 )","Status":"SS 17 ; USB (RED) ; GLOBAL","Dev_Warranty":"28-02-2017","Narration":""},{"Date":"17-05-2017","VchNo":"","VchType":"Upgrd. Composite","Details":"SS 17 to SM 17 ; KGSS ( BUC Consumed : 22.5 / INR 18000 )","Status":"SM 17 ; USB (RED) ; GLOBAL","Dev_Warranty":"28-02-2017","Narration":""}]
I am unable to receive "Suruchi" as output
When I connect my app with 'ashx' web service using OkHttpUtils2 then I receive only json string.
My code
MainActivity
B4X:
Sub Process_Globals
Dim job1 As HttpJob
End Sub
Public Sub checkSerialHistoryNo()
job1.Initialize("job1",Me)
job1.Download(http://192.148.0.33/UWS1/UWS/UMSServices.ashx)
job1.GetRequest.SetHeader("Password","pwd")
job1.GetRequest.SetHeader("Mode",3)
job1.GetRequest.SetHeader("SerialNo","123456")
End Sub
Sub JobDone (job As HttpJob)
Log("JobName = " & job.JobName & ", Success = " & job.Success)
If job.Success = True Then
Log(job.GetString) ' this will give only json string
Else
Log("Error: " & job.ErrorMessage)
ToastMessageShow("Error: " & job.ErrorMessage, True)
End If
job.Release
End Sub
Web service code:
B4X:
Dim ResponseStr As String = GetSNHistory(SerialNo, DealerCode, Mode, ErrMsg, IfSerialNoBlocked, InstallDetFound, InstallationDet) 'this receive data from database and send back to us as json string
context.Response.Write(ResponseStr) 'this is received by my app as json string
context.Response.AddHeader("PartyName", "Suruchi") 'this is not received
My Output
[{"Date":"02-03-2015","VchNo":" 43","VchType":"Production","Details":"","Status":"SS 14 ; USB (RED) ; GLOBAL","Dev_Warranty":"01-03-2016","Narration":""},{"Date":"30-03-2015","VchNo":" 4526","VchType":"Dispatch","Details":"KGSS","Status":"SS 14 ; USB (RED) ; GLOBAL","Dev_Warranty":"02-04-2016","Narration":""},{"Date":"29-02-2016","VchNo":" ","VchType":"Upgrd. Version","Details":"14 to 16 ; KGSS ( BUC Consumed : 2 / INR 1600 )","Status":"SS 16 ; USB (RED) ; GLOBAL","Dev_Warranty":"02-04-2016","Narration":""},{"Date":"01-03-2016","VchNo":" ","VchType":"Installation","Details":"WMMC INDIA","Status":"SS 16 ; USB (RED) ; GLOBAL","Dev_Warranty":"28-02-2017","Narration":""},{"Date":"15-05-2017","VchNo":"","VchType":"Upgrd. Composite","Details":"SS 16 to SS 17 ; KGSS ( BUC Consumed : 3 / INR 2400 )","Status":"SS 17 ; USB (RED) ; GLOBAL","Dev_Warranty":"28-02-2017","Narration":""},{"Date":"17-05-2017","VchNo":"","VchType":"Upgrd. Composite","Details":"SS 17 to SM 17 ; KGSS ( BUC Consumed : 22.5 / INR 18000 )","Status":"SM 17 ; USB (RED) ; GLOBAL","Dev_Warranty":"28-02-2017","Narration":""}]
I am unable to receive "Suruchi" as output
Last edited: