I'm new in B4A. I made a webservice by VB.net and tested successfully in vb.net. But when I tested in B4A, always failed. tried many times and ways.
url is correct and can test: http://www.sinosurveyor.com:5862/webtest.asmx
here follows my code:
#Region Project Attributes
#ApplicationLabel: LDAR
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private lblTitle As Label,txtLogin As EditText,txtCode As EditText,btnLogin As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
Activity.Title="login test"
lblTitle.left=15%x: lblTitle.Top=8%y: lblTitle.width=70%x: lblTitle.height=8%y
txtLogin.left=25%x: txtLogin.Top=18%y: txtLogin.width=50%x: txtLogin.height=8%y
txtCode.left=txtLogin.left: txtCode.Top=27%y: txtCode.width=txtLogin.width: txtCode.height=txtLogin.height
btnLogin.Left=37.5%x: btnLogin.Top=37%y: btnLogin.width=25%x: btnLogin.height=8%y
Dim job As HttpJob
job.Initialize("login", Me)
job.PostString("http://www.sinosurveyor.com:5862/webtest.asmx?op=fp", "a=5")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub JobDone(job As HttpJob)
If job.Success = True Then
Msgbox ("success!","")
Else
Msgbox("fault!","")
End If
job.Release()
End Sub
url is correct and can test: http://www.sinosurveyor.com:5862/webtest.asmx
here follows my code:
#Region Project Attributes
#ApplicationLabel: LDAR
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private lblTitle As Label,txtLogin As EditText,txtCode As EditText,btnLogin As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
Activity.Title="login test"
lblTitle.left=15%x: lblTitle.Top=8%y: lblTitle.width=70%x: lblTitle.height=8%y
txtLogin.left=25%x: txtLogin.Top=18%y: txtLogin.width=50%x: txtLogin.height=8%y
txtCode.left=txtLogin.left: txtCode.Top=27%y: txtCode.width=txtLogin.width: txtCode.height=txtLogin.height
btnLogin.Left=37.5%x: btnLogin.Top=37%y: btnLogin.width=25%x: btnLogin.height=8%y
Dim job As HttpJob
job.Initialize("login", Me)
job.PostString("http://www.sinosurveyor.com:5862/webtest.asmx?op=fp", "a=5")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub JobDone(job As HttpJob)
If job.Success = True Then
Msgbox ("success!","")
Else
Msgbox("fault!","")
End If
job.Release()
End Sub