Пример #1
0
        /// <summary>
        /// 解析Xml返回对象(支付回调)
        /// </summary>
        /// <param name="xmlString"></param>
        /// <returns></returns>
        public static SendFundProfitMessage GetProfitMsg(string pXmlString)
        {
            SendFundProfitMessage send = new SendFundProfitMessage();
            //Xml解析
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(pXmlString);
            //取得节点名为order的集合
            XmlNodeList xxList = doc.GetElementsByTagName("order");

            //xxNode是每一个<CL>...</CL>体
            foreach (XmlNode xxNode in xxList)
            {
                //取得CL下的子节点集合
                XmlNodeList childList = xxNode.ChildNodes;
                foreach (XmlNode node in childList)
                {
                    String temp = node.Name;
                    switch (temp)
                    {
                    case "MerchantID":
                        send.MerchantID = node.InnerText;
                        break;

                    case "Allpageno":
                        send.Allpageno = node.InnerText;
                        break;

                    case "Curpageno":
                        send.Curpageno = node.InnerText;
                        break;

                    case "Allcount":
                        send.Allcount = node.InnerText;
                        break;

                    case "Content":
                        send.Content = node.InnerText;
                        break;

                    case "Retcode":
                        send.Retcode = node.InnerText;
                        break;

                    case "Retmsg":
                        send.Retmsg = node.InnerText;
                        break;
                    }
                }
            }
            return(send);
        }
Пример #2
0
        /// <summary>
        /// 获取华安接口中:每万份收益、年化收益率(5002)
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        private void GetProfit()
        {
            DateTime dt = DateTime.Now;

            string seqNO = HuaAnFactory.GenerateSeqNO();

            //处理调用华安请求From表单对象
            //ReceiveProfitSelectMessage entity = AssignmentProfit(dt);  //查询年化收益率
            // ReceivePaySingleQueryMessage entity = AssignmentSingleQuery(dt);  //3001
            ReceiveFundProfitMessage entity = Assignment5000(dt);   //500
            string strContent            = Utility.GetRequsetXml(entity);
            HanAnRequestMessage rMessage = new HuaAnFactory().FormRequestContent(dt, strContent, 5001, seqNO);

            IDictionary <string, string> dic = HuaAnFactory.SetFormPara(rMessage);
            HttpWebResponse webResponse      = HttpHelper.CreatePostHttpResponse(HuaAnConfigurationAppSitting.ReservationServletUrl, dic, null, null, Encoding.UTF8, null);
            string          content          = HttpHelper.GetResponseString(webResponse);

            Hashtable    htComm = GetCommonreturn(content);
            HanAnMessage msg    = new HanAnMessage
            {
                verNum  = htComm["verNum"].ToString(),
                sysdate = htComm["sysdate"].ToString(),
                systime = htComm["systime"].ToString(),
                txcode  = htComm["txcode"].ToString(),
                seqNO   = htComm["seqNO"].ToString(),
                maccode = htComm["maccode"].ToString(),
                content = htComm["content"].ToString()
            };


            if (msg != null)
            {
                string decrypt = Utility.AESDecrypt(msg.content, HuaAnConfigurationAppSitting.AesKey);
                SendFundProfitMessage profitMsg = GetProfitMsg(decrypt);
                string[] profitN = profitMsg.Content.Split('\n');
                foreach (var item in profitN)
                {
                    string   profit      = item;
                    string[] profitArray = profit.Split('|');
                }
                //   string[] profit = profitMsg.Content.Split('|');
            }

            Model = rMessage;
        }