Skip to content

企微接收客户标签变更事件序列化成Bean异常 #2137

Closed

Description

@lixiaojie09

简要描述

接收客户标签变更事件时,
<xml> <SuiteId> <![CDATA[ww122cacf30fe7f949]]> </SuiteId> <AuthCorpId> <![CDATA[ww673a375b380d45e0]]> </AuthCorpId> <InfoType> <![CDATA[change_external_tag]]> </InfoType> <TimeStamp>1622182830</TimeStamp> <ChangeType> <![CDATA[update]]> </ChangeType> <Id> <![CDATA[etEsNADQAAaiB0cWCSDFiJ2qCap-ww9A]]> </Id> <TagType> <![CDATA[tag]]> </TagType> </xml>
使用代码 WxCpTpXmlMessage.fromXml(decryptXml) 转成 WxCpTpXmlMessage 出错。

模块版本情况

  • WxJava 模块名: weixin-java-cp
  • WxJava 版本号: 4.0.8.B

详细描述

CoversionException日志
---- Debugging information ----
cause-exception : java.lang.NumberFormatException
cause-message : For input string: "etEsNADQAAaiB0cWCSDFiJ2qCap-ww2b"
class : java.lang.Integer
required-type : java.lang.Integer
converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper
wrapped-converter : com.thoughtworks.xstream.converters.basic.IntConverter
line number : 1
class[1] : me.chanjar.weixin.cp.bean.message.WxCpTpXmlMessage
required-type[1] : me.chanjar.weixin.cp.bean.message.WxCpTpXmlMessage
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : not available

Activity

  1. binarywang commented on May 30, 2021

    @binarywang
    Owner

    看来是id类型不匹配,应该改为String

    cause-message : For input string: "etEsNADQAAaiB0cWCSDFiJ2qCap-ww2b"

  2. added this to the 4.1.0 milestone on May 30, 2021
  3. added a commit that references this issue on May 30, 2021
  4. lixiaojie09 commented on May 30, 2021

    @lixiaojie09
    Author

    是的,确实是id是整型所引起的。但我不确定更改为String类型后,是否会影响到原有整形xml信息的convert。例如部门的XML消息。https://work.weixin.qq.com/api/doc/90001/90143/90640

  5. binarywang commented on May 30, 2021

    @binarywang
    Owner

    单元测试跑下就知道了,没问题,已试过

  6. added a commit that references this issue on May 30, 2021
  7. lixiaojie09 commented on May 30, 2021

    @lixiaojie09
    Author

    ok! thk~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions