mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-30 10:07:06 +08:00
fix #53 模板 消息发送后,微信服务推送的发送状态的xml结构信息内的msgID 没有被WxMpXmlMessage 识别
This commit is contained in:
@ -381,6 +381,8 @@ public class WxMpXmlMessage {
|
||||
|
||||
public static WxMpXmlMessage fromXml(String xml) {
|
||||
try {
|
||||
// 操蛋的微信,模板消息推送成功的消息是MsgID,其他消息推送过来是MsgId
|
||||
xml = xml.replaceAll("<MsgID>", "<MsgId>").replaceAll("</MsgID>", "</MsgID>");
|
||||
return XmlTransformer.fromXml(WxMpXmlMessage.class, xml);
|
||||
} catch (JAXBException e) {
|
||||
throw new RuntimeException(e);
|
||||
@ -389,8 +391,8 @@ public class WxMpXmlMessage {
|
||||
|
||||
public static WxMpXmlMessage fromXml(InputStream is) {
|
||||
try {
|
||||
return XmlTransformer.fromXml(WxMpXmlMessage.class, is);
|
||||
} catch (JAXBException e) {
|
||||
return fromXml(IOUtils.toString(is, "UTF-8"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user