Тема: Application problem error:1 Asp.net/VB
I need your advice about the following problems I faced with some applications that was developed on wialon Local using wialon API/ASP.net-VB
when running any application from outside our local network, it generates (error:1), but when the same application is being used from inside our premises, it works properly.
please see the following CODE :
Public wialonurl As String = "http://---------/wialon/ajax.html?svc="
Public Function getvehicle() As String
Dim sid As String = Request.QueryString("sid")
Dim objText As String
Dim result As String = ""
Dim url = wialonurl & "core/search_items¶ms={spec:{itemsType:avl_unit,propName:sys_id,propValueMask:*,sortType:*,propType:*},force:1,flags:0x00000001,from:0,to:0}&sid=" & sid
Dim req = DirectCast(WebRequest.Create(url), HttpWebRequest)
Using reader = New StreamReader(req.GetResponse().GetResponseStream())
objText = reader.ReadToEnd()
End Using
If objText.Contains("error") Then
result = objText
Else
Dim json As JObject = DirectCast(JObject.Parse(objText), JObject)
Dim arrText As String = json("items").ToString()
result = arrText
End If
Return result
End Function
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
TextBox1.Text = getvehicle()
End Sub