/// <summary> /// 数据提取 /// 重写 /// </summary> /// <see cref="getData"/> /// <param name="requestbody"></param> /// <returns></returns> public override byte[] ExtractData(byte[] responsebody) { //获取WCF Message string strWCFMsg = _mh.GetWcfBinaryMessageAsText(responsebody); //获取WCF Content Binary(=WCF Message Body) byte[] wcfbin = WCFMessageUtil.getWCFBinByWCFMsg(strWCFMsg, tag, WCFContentFormat); //解密 string jsonString = DecryptAES(Encoding.UTF8.GetString(wcfbin), "qjkHuIy9D/9i=", "Mi9l/+7Zujhy12se6Yjy111A"); return(Encoding.UTF8.GetBytes(jsonString)); }
/// <summary> /// 数据提取 /// .可以重写 /// </summary> /// <remarks> /// 提取Bin形式的WCFMessge为XML形式的WCFMessage,根据属性ExtractWCFContent、WCFContentFormat提取WCFContent /// </remarks> /// <param name="responsebody"></param> /// <returns></returns> public virtual byte[] ExtractData(byte[] responsebody) { //获取WCF Message string strWCFMsg = _mh.GetWcfBinaryMessageAsText(responsebody); byte[] wcfbin = null; if (ExtractWCFContent) { //从WCF Message提取WCF Message Body,转化为WCF Content Binary //获取WCF Content Binary wcfbin = WCFMessageUtil.getWCFBinByWCFMsg(strWCFMsg, Tag, WCFContentFormat); } else { wcfbin = Encoding.UTF8.GetBytes(strWCFMsg); } return(wcfbin); }