public DataTable GetDataValuesSOAP(string start, string end, string siteCode, string variableCode, string url) { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("time", typeof(DateTime))); dt.Columns.Add(new DataColumn("value", typeof(double))); System.Collections.Generic.IList<DataValues.DataValues> ListDataValue = new System.Collections.Generic.List<DataValues.DataValues>(); XMLSerialization objXMLSerialization = new XMLSerialization(); string xml = CallWebService(url, siteCode, variableCode, start, end); ListDataValue = objXMLSerialization.ParseGetValues(xml); var ListVariableInfo = objXMLSerialization.GetMetaData(xml); if (ListVariableInfo.Count > 0) VariableName = ListVariableInfo[0].ToString(); else VariableName = "unknown variable"; if (ListVariableInfo.Count > 1) YAxisvalue = ListVariableInfo[1].ToString(); else XAxisvalue = "unknown units"; if (ListVariableInfo.Count > 2) XAxisvalue = ListVariableInfo[2].ToString(); else XAxisvalue = "unknown units"; for (int i = 0; i < ListDataValue.Count; i++) { DataRow row = dt.NewRow(); row["time"] = ListDataValue[i].LocalDateTime; row["value"] = ListDataValue[i].Value; dt.Rows.Add(row); } return dt; }