public DataSet GetXmlData()
{
string url="http://localhost:16800";
HttpWebRequest req=(HttpWebRequest)WebRequest.Create(url);
req.Method="POST";
//插入公司内部服务的一个头
req.Headers.Add("rBeacon-Service","1001");
req.ContentType="application/x-www-form-urlencoded";
XmlDocument doc=new XmlDocument();
doc.Load("query.xml");
string para=doc.OuterXml;
StreamWriter myWriter=new StreamWriter(req.GetRequestStream());
myWriter.Write(para);
myWriter.Close();
HttpWebResponse rsp=(HttpWebResponse)req.GetResponse();
DataSet ds=new DataSet();
ds.ReadXml(rsp.GetResponseStream(),XmlReadMode.Auto);
return ds;
}
{
string url="http://localhost:16800";
HttpWebRequest req=(HttpWebRequest)WebRequest.Create(url);
req.Method="POST";
//插入公司内部服务的一个头
req.Headers.Add("rBeacon-Service","1001");
req.ContentType="application/x-www-form-urlencoded";
XmlDocument doc=new XmlDocument();
doc.Load("query.xml");
string para=doc.OuterXml;
StreamWriter myWriter=new StreamWriter(req.GetRequestStream());
myWriter.Write(para);
myWriter.Close();
HttpWebResponse rsp=(HttpWebResponse)req.GetResponse();
DataSet ds=new DataSet();
ds.ReadXml(rsp.GetResponseStream(),XmlReadMode.Auto);
return ds;
}