How a REST call works.
If you need additional specific information about this topic or if you want to look it personally please write an email
Sum (a, b) = a + b
Light (LightValue)
Getcoordinates()
LATITUDE=1233.715480&LONGITUDE=4155.726918
http://www.test.org/Georeference.aspx?SOURCE=74KM&TIME=00:11:36&DATE=04/01/01&LATITUDE=1233.715480&LONGITUDE=4155.726918
//GeoReferences.aspx
//Author: Vittorio Margherita
//Version 4.51
public partial class WebForm1 : System.Web.UI.Page
{
string ArduSource;
string ArduTime;
string ArduDate;
string ArduLatitude;
string ArduLongitude;
bool QueryMissedParam;
protected void Page_Load(object sender, EventArgs e)
{
XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, System.Text.Encoding.UTF8);
DateTime TimeOfTheDay, DayOfTheDate;
GeoReference GeoString = new GeoReference();
DatabaseConnectionDataContext db = new DatabaseConnectionDataContext();
ArduSource = Request.QueryString["SOURCE"];
ArduTime = Request.QueryString["TIME"];
ArduDate = Request.QueryString["DATE"];
ArduLatitude = Request.QueryString["LATITUDE"];
ArduLongitude = Request.QueryString["LONGITUDE"];
//check if the current App is authorised to work
var query =
from righe in db.AllowedPCCs
where
(righe.PCC == ArduSource)
select righe;
//Initialize the Answer Node
writer.WriteStartDocument();
writer.WriteStartElement("GeoLocalization");
if (query.Count() == 0)
{
writer.WriteElementString("Insert", "False");
writer.WriteElementString("ReturnMessage", "ERROR: Appliance not authorised");
}
else
{
//Converting strings received to positional strings
//Caller
GeoString.Source = ArduSource;
//Time
TimeOfTheDay = Convert.ToDateTime(ArduTime);
GeoString.Time = TimeOfTheDay.TimeOfDay;
//Day
DayOfTheDate = Convert.ToDateTime(ArduDate);
GeoString.Date = DayOfTheDate.Date;
//Position
GeoString.Latitude = float.Parse(ArduLatitude);
GeoString.longitude = float.Parse(ArduLongitude);
//Enter the node
try
{
db.GeoReferences.InsertOnSubmit(GeoString);
db.SubmitChanges();
writer.WriteElementString("Insert", "true");
writer.WriteElementString("ReturnMessage", "Reference string enetered Correctly");
}
catch (Exception Exch)
{
writer.WriteElementString("Insert", "False");
writer.WriteElementString("ReturnMessage", "ERROR: String has not been entered");
}
}
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
Response.End();
}
}