Hi!
I am trying to do a module to wrap everything for callilng webservices
this is my module
I wanna use something like that st1=ExecuteWs(1) but like I saw it cant be because the method that return a value is hc_ResponseSuccess so my question is
How can I return the value from ExecuteWS ?
Thks
I am trying to do a module to wrap everything for callilng webservices
this is my module
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'
Dim url As String: url="http://192.168.52.131/ssl/server.php?id="
Dim hc As HttpClient
Dim IdCall As Int : Idcall=101 'ID inicial de las llamadas que se haran a los WS
hc.Initialize("hc")
End Sub
Sub ExecuteWs(ind as Int)
Dim req As HttpRequest
Dim query As String
Dim taskId As Int :taskId=IdCall+2
query="2"
req.InitializePost2(url, query.GetBytes("UTF8"))
hc.Execute(req, taskId)
End Sub
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, taskId As Int)
Log("Error: " & Reason & ", StatusCode: " & StatusCode)
If Response <> Null Then
Log(Response.GetString("UTF8"))
Response.Release
End If
'ProgressDialogHide
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, taskId As Int)
Dim res As String
res = Response.GetString("UTF8")
Response.Release
Return res
End Sub
I wanna use something like that st1=ExecuteWs(1) but like I saw it cant be because the method that return a value is hc_ResponseSuccess so my question is
How can I return the value from ExecuteWS ?
Thks