WebClient client = new WebClient();
client.Headers.Clear();
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
client.Encoding = Encoding.GetEncoding("gbk");
string data = "&userCode = " + this.Property.userCode + " & userPwd = " + this.Property.userPwd + "&date=" + t.ToString("yyyy-MM-dd") +"&ifSearched="+this.Property.IfSearched;
byte[] b = client.UploadData(this.Property.callUrl, "post", Encoding.GetEncoding("gbk").GetBytes(data));
//var resultXml = this.Post(this.Property.callUrl,new {
string resultXml= System.Text.Encoding.GetEncoding("gbk").GetString(b);
this.LogInfo("上行返回:" + resultXml);
resultXml = resultXml.CleanInvalidXmlChars();
var doc = new System.Xml.XmlDocument();
doc.LoadXml(resultXml);
var headArray = doc.SelectNodes("/response/head");
string status = headArray[0].SelectSingleNode("code").InnerText;
string body = doc.SelectNodes("/response/body")[0].InnerXml;
if (status=="1"&&!string.IsNullOrWhiteSpace(body))
{
var bodyArray = doc.SelectNodes("/response/body/record");
foreach (System.Xml.XmlNode item in bodyArray)
{
string taskid= item.SelectSingleNode("deal_id").InnerText;
string mobile = item.SelectSingleNode("phone").InnerText;
string receivetime = item.SelectSingleNode("recv_date").InnerText;
string content = item.SelectSingleNode("content").InnerText;
this.LogInfo("获取的上行信息=" + "1:" + mobile + " 2:" + taskid + " 3:" + content + " 4:" + receivetime + "
");
this.NotifyReceiveMo(mobile, content);
}
}