Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lixiaojie09 opened this issue May 28, 2021 · 4 comments
Closed

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

lixiaojie09 opened this issue May 28, 2021 · 4 comments
Milestone

Comments

@lixiaojie09
Copy link

简要描述

接收客户标签变更事件时,
<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

@binarywang
Copy link
Member

binarywang commented May 30, 2021

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

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

@lixiaojie09
Copy link
Author

lixiaojie09 commented May 30, 2021

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

@binarywang
Copy link
Member

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

@lixiaojie09
Copy link
Author

ok! thk~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants