| @@ -381,6 +381,8 @@ public class WxMpXmlMessage { | |||||
| public static WxMpXmlMessage fromXml(String xml) { | public static WxMpXmlMessage fromXml(String xml) { | ||||
| try { | try { | ||||
| // 操蛋的微信,模板消息推送成功的消息是MsgID,其他消息推送过来是MsgId | |||||
| xml = xml.replaceAll("<MsgID>", "<MsgId>").replaceAll("</MsgID>", "</MsgID>"); | |||||
| return XmlTransformer.fromXml(WxMpXmlMessage.class, xml); | return XmlTransformer.fromXml(WxMpXmlMessage.class, xml); | ||||
| } catch (JAXBException e) { | } catch (JAXBException e) { | ||||
| throw new RuntimeException(e); | throw new RuntimeException(e); | ||||
| @@ -389,8 +391,8 @@ public class WxMpXmlMessage { | |||||
| public static WxMpXmlMessage fromXml(InputStream is) { | public static WxMpXmlMessage fromXml(InputStream is) { | ||||
| try { | try { | ||||
| return XmlTransformer.fromXml(WxMpXmlMessage.class, is); | |||||
| } catch (JAXBException e) { | |||||
| return fromXml(IOUtils.toString(is, "UTF-8")); | |||||
| } catch (IOException e) { | |||||
| throw new RuntimeException(e); | throw new RuntimeException(e); | ||||
| } | } | ||||
| } | } | ||||