Closed
Description
简要描述
服务端在接收用户发送的消息调用WxCpXmlMessage.fromEncryptedXml进行解密时报错,java.lang.RuntimeException: AppID不正确,但是用户发送的消息是能接收到。请问这个AppID指的是什么?目前项目里面只配置了corpId和suiteId。
模块版本情况
- WxJava 模块名: weixin-java-cp
- WxJava 版本号: 3.4.0
详细描述
如下是处理用户发送信息的逻辑
@PostMapping(produces = "application/xml; charset=UTF-8")
public String post(@PathVariable("corpId") String corpId,
@RequestBody String requestBody,
@RequestParam("msg_signature") String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce) {
log.info("\n数据回调:[signature=[{}], timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
signature, timestamp, nonce, requestBody);
try {
final WxCpService wxCpService = WxCpConfiguration.getCpServices(corpId);
WxCpXmlMessage inMessage = null;
if (wxCpService == null) {
final WxCpService cpService = configuration.getCpServices(corpId);
inMessage = WxCpXmlMessage.fromEncryptedXml(requestBody, cpService.getWxCpConfigStorage(),
timestamp, nonce, signature);
} else {
inMessage = WxCpXmlMessage.fromEncryptedXml(requestBody, wxCpService.getWxCpConfigStorage(),
timestamp, nonce, signature);
}
this.route(corpId, inMessage);
return "success";
} catch (Exception e) {
e.printStackTrace();
}
return "";