Example #1
0
        public ActionResult notice(PostModel postModel)
        {
            postModel.Token          = WxRequest._component_Token;
            postModel.EncodingAESKey = WxRequest._component_EncodingAESKey;           //根据自己后台的设置保持一致
            postModel.AppId          = WxRequest._component_AppId;                    //根据自己后台的设置保持一致
            XDocument doc = WXRequestCommandBLL.Init(Request.InputStream, postModel); //执行

            WXRequestCommandBLL.CommandWXCallback(doc, postModel);

            return(Content("success"));
        }
Example #2
0
        public ActionResult Callback(PostModel postModel)
        {
            //此处的URL格式类型为:http://weixin.senparc.com/Open/Callback/$APPID$, 在RouteConfig中进行了配置,你也可以用自己的格式,只要和开放平台设置的一致。
            if (postModel == null)
            {
                log4net.LogHelper.WriteInfo(this.GetType(), "微信回调信息postModel为null");
                return(Content("success"));
            }

            postModel.Token          = WxRequest._component_Token;
            postModel.EncodingAESKey = WxRequest._component_EncodingAESKey;              //根据自己后台的设置保持一致
            postModel.AppId          = WxRequest._component_AppId;                       //根据自己后台的设置保持一致
            XDocument doc    = WXRequestCommandBLL.Init(Request.InputStream, postModel); //执行
            string    result = WXRequestCommandBLL.CommandWXCallback(doc, postModel);

            return(Content(result));
        }