收藏
回答

微信公众号授权第三方后,无法正常转发客服消息,怎么办?

这个是后台消息回调接口相应的代码:

StringBuffer sb = new StringBuffer();
sb.append("<xml>");
sb.append("<CreateTime><" + createTime + "></CreateTime>");
sb.append("<FromUserName><![CDATA["+ toUserName +"]]></FromUserName>");
sb.append("<MsgType><![CDATA[transfer_customer_service]]></MsgType>");
sb.append("<ToUserName><![CDATA["+fromUserName+"]]></ToUserName>");
sb.append("</xml>");
String replyMsg = sb.toString();

try {
   WXBizMsgCrypt pc = new WXBizMsgCrypt(token, encodingaeskey, appid);
   replyMsg = pc.encryptMsg(replyMsg, createTime.toString(), "easemob");
} catch (AesException e) {
   e.printStackTrace();
}
response.getWriter().write(replyMsg);

这个是公众号的报警日志,

Appid: ***
昵称: ***
时间: 2020-02-11 13:47:47
内容: 微信服务器向公众号推送消息或事件后,得到的回应不合法
次数: 5分钟 2次
错误样例: [OpenID=ogJFp6MWmA0gJt2r9ot29zBgFt0o][Stamp=1581400067][3rdUrl=http://ewz9hw.natappfree.cc/wxMessage/receive/wx7b89df3f67574652][IP=112.74.89.58][MsgType=1][Msg=Text][decrypt fail][response_length=591][response_content=<xml>
<Encrypt><![CDATA[Oxi5q4UJQTlvNVl4+Jx2l/QJ20u1ZJGNagwQmZ7mvTnIUNDjpXFd9Nt3obTCcmk478N+aOUKRFBY
RdEtgtUYRSIzVKdQ8vThC8cHrw1M5+Q+HUGZIq/HqadyWsMlohFnQ5yfBJPVvgnM9LEL6h5wQr4h
oXfCYaP0A90c/KdcXqopVEaK1LeN02ln3B/TA5cKy+ZrgrNizbKWJ25vgAmAhpVDpPXuw55IC+H0
CLjdiF2l3z9ll7H0S9CMB+xbWKeiuMk83dMxdveC4A68/u9ZGH8aSy7/iPHUPzg6AbQ+r/xCu1kx
odVMAnX0ajo9q7OuUrQUBiHAYKeHVqcoF+qLzTjpJKra9uvSedxwO6a2WiAvn1VL3W454ctA4pzF
e+Y1
]]></Encrypt>
<MsgSignature><![CDATA[012e69bc7abd55642809113a5a862528b3eef1d9]]></MsgSignature>
<TimeStamp>1581400066</TimeStamp>
<Nonce><![CDATA[easemob]]></Nonce>
</xml>][第三方平台:***]
报警排查指引,请见: https://w.url.cn/s/A1dMqXI


日志提示decrypt fail,解码失败,请问怎么知道哪里出错了?

最后一次编辑于  02-12
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签