Hello I'm developing an android application .. which will send location data to a web service to store in the server database.
In Java: I've used this protocol so the URI is: HTTP request instead of REST
HttpPost request = new HttpPost("http://trafficmapsa.com/GService.asmx/GPSdata? lon="+Lon+"&Lat="+Lat+"&speed="+speed);
In Asp.net (c#) web service will be:
[WebMethod] public CountryName GPSdata(Double Lon, Double Lat, Double speed) { String ConnStr = ConfigurationManager.ConnectionStrings["TrafficMapConnectionString"].ConnectionString; SqlConnection myConnection = new SqlConnection(ConnStr); SqlCommand myCommand = new SqlCommand("INSERT INTO Traffic(Longitude,Latitude,Speed,Distance,Time,MAC_Address) VALUES('" + (@Lon).ToString() + "','" + (@Lat).ToString() + "','" + (@speed).ToString() )", myConnection); SqlDataAdapter sadp = new SqlDataAdapter(); sadp.SelectCommand = myCommand; myConnection.Open(); DataSet DS = new DataSet(); myCommand.ExecuteNonQuery(); myConnection.Close();
after passing the data from android ..nothing return in back .. and there is no data in the database!! Is there any library missing in the CS file!! I cannot figure out what is the problem.