Hi there,
I need your support in order to solve a problem that has me stuck, the point is that I need to consume the temperature from web service, I found an example from a tutorial but I think it is not complete. The following is part of the code, when try to run it i get the error:
"resultSoapXML = Response.GetString("UTF8")
Java.lang.NullPointerException"
I hope this is clear enough, or if something else is needed, please let me know.
Thanks in advance.
'Service module
Sub Process_Globals
Dim hc As HttpClient 'download the page
Dim hcimage As HttpClient 'download the image
Dim req As HttpRequest
Dim reqimage As HttpRequest
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub Globals
Dim temp As String
Dim btnweather As Button
Dim edtweather As EditText
Dim lbltemperature As Label
Dim img As Bitmap
'Set a default start city when there is nothing in the DB
Dim selectedcity As String :selectedcity ="Christchurch"
Dim townpath As String
Dim label1 As Label ‘holds the temp
Dim imgtemp As ImageView
Dim pic As String 'holds the image
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
hc.Initialize("hc")
hcimage.Initialize("hcimage")
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub btnweather_click
strplace = "christchurch" 'note its lower case
townpath = "http://m.metservice.com/towns/"& strplace
req.InitializeGet(townpath)
hc.Execute(req, 1)
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub hc_ResponseSuccess(Response AsHttpResponse, TaskId AsInt)
Dim temp As String
temp = Response.GetString("UTF8") 'Get the whole page
…..
When the bolded line is achieved, i get the mentioned message.
I need your support in order to solve a problem that has me stuck, the point is that I need to consume the temperature from web service, I found an example from a tutorial but I think it is not complete. The following is part of the code, when try to run it i get the error:
"resultSoapXML = Response.GetString("UTF8")
Java.lang.NullPointerException"
I hope this is clear enough, or if something else is needed, please let me know.
Thanks in advance.
'Service module
Sub Process_Globals
Dim hc As HttpClient 'download the page
Dim hcimage As HttpClient 'download the image
Dim req As HttpRequest
Dim reqimage As HttpRequest
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub Globals
Dim temp As String
Dim btnweather As Button
Dim edtweather As EditText
Dim lbltemperature As Label
Dim img As Bitmap
'Set a default start city when there is nothing in the DB
Dim selectedcity As String :selectedcity ="Christchurch"
Dim townpath As String
Dim label1 As Label ‘holds the temp
Dim imgtemp As ImageView
Dim pic As String 'holds the image
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
hc.Initialize("hc")
hcimage.Initialize("hcimage")
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub btnweather_click
strplace = "christchurch" 'note its lower case
townpath = "http://m.metservice.com/towns/"& strplace
req.InitializeGet(townpath)
hc.Execute(req, 1)
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub hc_ResponseSuccess(Response AsHttpResponse, TaskId AsInt)
Dim temp As String
temp = Response.GetString("UTF8") 'Get the whole page
…..
When the bolded line is achieved, i get the mentioned message.