fix #53 模板 消息发送后,微信服务推送的发送状态的xml结构信息内的msgID 没有被WxMpXmlMessage 识别

This commit is contained in:
Daniel Qian
2014-12-19 12:14:03 +08:00
parent 28312a71a0
commit c6b5ce63e9

View File

@ -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);
}
}