微信公众平台api 不能接收来自普通用户的post的消息
我的代码 如下 :请教高手指点。为什么不能接收到消息
public partial class Default : System.Web.UI.Page,IHttpHandler
{
const string Token = "1005sunyafen"; //与那边填写的token一致
protected void Page_Load(object sender, EventArgs e)
{
string postStr = "";
if (Request.HttpMethod.ToLower() == "post") //post方式
{
Stream s = Request.InputStream;
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
postStr = Encoding.UTF8.GetString(b);
if (!string.IsNullOrEmpty(postStr))
{
//封装请求类
XmlDocument doc = new XmlDocument();
doc.LoadXml(postStr);
XmlElement rootElement = doc.DocumentElement;
XmlNode MsgType = rootElement.SelectSingleNode("MsgType");
RequestXML requestXML = new RequestXML();
requestXML.ToUserName = rootElement.SelectSingleNode("ToUserName").InnerText;
requestXML.FromUserName = rootElement.SelectSingleNode("FromUserName").InnerText;
requestXML.CreateTime = rootElement.SelectSingleNode("CreateTime").InnerText;
requestXML.MsgType = MsgType.InnerText;
&