Hello everyone,
I have a server running a service made with B4J and 2 apps (B4A and B4i) that connect with them.
In some case I need to answer with an error number and an error message from the service that I need to catch and use it in the apps
Let me show you the code, it's very easy:
And this is the code in B4A and B4i:
In B4A works perfect, job.ErrorMessage receives "355238", "974520" or the number (string in fact) that I send from B4J, but in B4i it does not receive the job.ErrorMessage, only the Status code.
How can I receive in B4i the ErrorMessage?
@Erel told me that I shouldn't expect it to work because I'm using non-standard status codes... but it works fines and smoothly on B4A, why it does not work in B4i?
I also read a lot of posts about this problem but did not find any solution, in fact in a post made in 2020 it says "next B4i release will have this fixed" or something like that ... but I guess is not solved
Any helps will be highly appreciated
Many Thanks
I have a server running a service made with B4J and 2 apps (B4A and B4i) that connect with them.
In some case I need to answer with an error number and an error message from the service that I need to catch and use it in the apps
Let me show you the code, it's very easy:
B4J Service:
Case "F"
resp.SendError(15,"355238")
Case "G"
resp.SendError(16,"974520")
B4i and B4A:
j.PostString(strServidor,"Data=" & EncryptText(MyJG.ToString))
wait for (j) JobDone (job As HttpJob)
If job.Success Then
...
Else
Select Case job.Response.StatusCode
Case 15
lblResultado.Text="something goes here " & job.ErrorMessage
Case 16
lblResultado.Text="something different goes here " & job.ErrorMessage
End Select
end if
How can I receive in B4i the ErrorMessage?
@Erel told me that I shouldn't expect it to work because I'm using non-standard status codes... but it works fines and smoothly on B4A, why it does not work in B4i?
I also read a lot of posts about this problem but did not find any solution, in fact in a post made in 2020 it says "next B4i release will have this fixed" or something like that ... but I guess is not solved
Any helps will be highly appreciated
Many Thanks