http post data and recieve
hey frnds , i have developed client application on windows mobile 6.5 that retrieves system info . Now i need to post this info on asp.net website which is running on local machine. And later recieve that info. How to do it. I tried many codes but coudnt solve it. Plz help
Micke BlomqvistPosted Feb 6, 2011, 9:09 AM
Noel FernandesPosted Feb 4, 2011, 10:35 AM
Micke BlomqvistPosted Feb 4, 2011, 7:34 AM
Try setting up a webservice in your ASP.NET solution which takes a string or a DataSet as a parameter. String or DataSet depending on the structure of the data you want to receive. Is it in a table format, I would go for the DataSet way.
Add a webservice, create a new public method:
[WebMethod]
public string ReceiveDataFromDevice(System.Data.DatSet dsFromDevice, string DeviceName)
{
//handle the dataset here, for example;
dsFromDevice.WriteXml(Server.MapPath("deviceData_" + DeviceName + ".xml"));
return "save ok";
}
To receive back the data to the device, set up a new public method in your webservice, something like this:
[WebMethod]
public void GetUploadedDataBackToDevice(string DeviceName)
{
//read in the data here, for example
using(System.Data.DataSet ds = new System.Data.DataSet())
{
ds.ReadXml(Server.MapPath("deviceData_" + DeviceName + ".xml"));
return ds;
}
}
I left out all the exception handling, but I guess you'll get the point.