Que tal,
Soy nuevo en éste ambiente, solicito su apoyo a fin de ver como puedo resolver un problema que me tiene atorado desde el viernes pasado, el punto es que requiero consumir la temperatura de un web service, encontré un ejemplo en un tutorial pero me parece que no está completo. Le muestro el ejemplo:
'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
'Log(townpath)
req.InitializeGet(townpath)
hc.Execute(req, 1)
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub hc_ResponseSuccess(Response AsHttpResponse, TaskId AsInt)
DimtempAsString
temp = Response.GetString("UTF8") 'Get the whole page
…..
Cuando llega a la última línea del código mostrado, manda el siguiente error:
resultSoapXML = Response.GetString(“UTF-8”)
java.lang.NullPointerException
Continue?
Gracias anticipadas
Soy nuevo en éste ambiente, solicito su apoyo a fin de ver como puedo resolver un problema que me tiene atorado desde el viernes pasado, el punto es que requiero consumir la temperatura de un web service, encontré un ejemplo en un tutorial pero me parece que no está completo. Le muestro el ejemplo:
'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
'Log(townpath)
req.InitializeGet(townpath)
hc.Execute(req, 1)
End Sub
''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Sub hc_ResponseSuccess(Response AsHttpResponse, TaskId AsInt)
DimtempAsString
temp = Response.GetString("UTF8") 'Get the whole page
…..
Cuando llega a la última línea del código mostrado, manda el siguiente error:
resultSoapXML = Response.GetString(“UTF-8”)
java.lang.NullPointerException
Continue?
Gracias anticipadas