File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -381,6 +381,8 @@ public void setFromUserName(String fromUserName) {
381381
382382 public static WxMpXmlMessage fromXml (String xml ) {
383383 try {
384+ // 操蛋的微信,模板消息推送成功的消息是MsgID,其他消息推送过来是MsgId
385+ xml = xml .replaceAll ("<MsgID>" , "<MsgId>" ).replaceAll ("</MsgID>" , "</MsgID>" );
384386 return XmlTransformer .fromXml (WxMpXmlMessage .class , xml );
385387 } catch (JAXBException e ) {
386388 throw new RuntimeException (e );
@@ -389,8 +391,8 @@ public static WxMpXmlMessage fromXml(String xml) {
389391
390392 public static WxMpXmlMessage fromXml (InputStream is ) {
391393 try {
392- return XmlTransformer . fromXml (WxMpXmlMessage . class , is );
393- } catch (JAXBException e ) {
394+ return fromXml (IOUtils . toString ( is , "UTF-8" ) );
395+ } catch (IOException e ) {
394396 throw new RuntimeException (e );
395397 }
396398 }
You can’t perform that action at this time.
0 commit comments