if (qrequest != null)
{
string strPost = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<SearchRequest>"
+ "<SPID>" + qrequest.SPID + "</SPID>"
+ "<Sign>" + qrequest.Sign + "</Sign>"
+ "<Timestamp>" + qrequest.Timestamp + "</Timestamp>"
+ "<GoodsCode>" + qrequest.GoodsCode + "</GoodsCode>"
+ "<IPAddress>" + qrequest.IPAddress + "</IPAddress>"
+ "<WeixinId>" + qrequest.WeixinId + "</WeixinId>"
+ "<PhoneCode>" + qrequest.PhoneCode + "</PhoneCode>"
+ "<IMEI>" + qrequest.IMEI + "</IMEI>"
+ "<Type>" + (int)qrequest.Type + "</Type>"
+ "</SearchRequest>";
string result = "";
StreamWriter myWriter = null;
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(InterfaceAddress);
objRequest.Method = "POST";
//objRequest.ContentType = "text/xml";//提交xml
try
{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}
catch (Exception ex)
{
err = ex.Message;
}
finally
{
myWriter.Close();
}
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
{
result = sr.ReadToEnd();
sr.Close();
}
PanPassModel.OutEx.SearchResponse P = (PanPassModel.OutEx.SearchResponse)Deserialize(typeof(PanPassModel.OutEx.SearchResponse), result);
{
string strPost = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<SearchRequest>"
+ "<SPID>" + qrequest.SPID + "</SPID>"
+ "<Sign>" + qrequest.Sign + "</Sign>"
+ "<Timestamp>" + qrequest.Timestamp + "</Timestamp>"
+ "<GoodsCode>" + qrequest.GoodsCode + "</GoodsCode>"
+ "<IPAddress>" + qrequest.IPAddress + "</IPAddress>"
+ "<WeixinId>" + qrequest.WeixinId + "</WeixinId>"
+ "<PhoneCode>" + qrequest.PhoneCode + "</PhoneCode>"
+ "<IMEI>" + qrequest.IMEI + "</IMEI>"
+ "<Type>" + (int)qrequest.Type + "</Type>"
+ "</SearchRequest>";
string result = "";
StreamWriter myWriter = null;
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(InterfaceAddress);
objRequest.Method = "POST";
//objRequest.ContentType = "text/xml";//提交xml
try
{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}
catch (Exception ex)
{
err = ex.Message;
}
finally
{
myWriter.Close();
}
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
{
result = sr.ReadToEnd();
sr.Close();
}
PanPassModel.OutEx.SearchResponse P = (PanPassModel.OutEx.SearchResponse)Deserialize(typeof(PanPassModel.OutEx.SearchResponse), result);