Skip to content

接收不到拍照或发图的事件推送 #305

Closed

Description

@xiaohe27

用户拍照或者发图后,后台可以收到image类的用户消息,可是收不到事件推送。
经过排查,发现微信已经推送了事件,我的服务器也接到了加密的事件推送消息,消息解密也完成了,
但是在构建WxCpXmlMessage时遇到了问题:

---- Debugging information ----
field               : picList
class               : me.chanjar.weixin.cp.bean.WxCpXmlMessage$SendPicsInfo
required-type       : me.chanjar.weixin.cp.bean.WxCpXmlMessage$SendPicsInfo
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
line number         : 1
class[1]            : me.chanjar.weixin.cp.bean.WxCpXmlMessage
version             : 1.4.7

发现解密过的xml里面的确有多个picList:

<xml><ToUserName><![CDATA[wx45a0972125658be9]]></ToUserName><FromUserName><![CDATA[xiaohe]]></FromUserName><CreateTime>1502012364</CreateTime><MsgType><![CDATA[event]]></MsgType><AgentID>1000004</AgentID><Event><![CDATA[pic_weixin]]></Event><EventKey><![CDATA[faceSimilarity]]></EventKey><SendPicsInfo><PicList><item><PicMd5Sum><![CDATA[aef52ae501537e552725c5d7f99c1741]]></PicMd5Sum></item></PicList><PicList><item><PicMd5Sum><![CDATA[c4564632a4fab91378c39bea6aad6f9e]]></PicMd5Sum></item></PicList><Count>2</Count></SendPicsInfo></xml>

这个算是微信那边推送了错误的格式么?我觉得多个照片就该是PicList里面的多个item啊。
@binarywang

Activity

  1. binarywang commented on Aug 10, 2017

    @binarywang
    Owner
    <xml>
    	<ToUserName><![CDATA[wx45a0972125658be9]]></ToUserName>
    	<FromUserName><![CDATA[xiaohe]]></FromUserName>
    	<CreateTime>1502012364</CreateTime>
    	<MsgType><![CDATA[event]]></MsgType>
    	<AgentID>1000004</AgentID>
    	<Event><![CDATA[pic_weixin]]></Event>
    	<EventKey><![CDATA[faceSimilarity]]></EventKey>
    	<SendPicsInfo>
    		<PicList>
    			<item>
    				<PicMd5Sum><![CDATA[aef52ae501537e552725c5d7f99c1741]]></PicMd5Sum>
    			</item>
    		</PicList>
    		<PicList>
    			<item>
    				<PicMd5Sum><![CDATA[c4564632a4fab91378c39bea6aad6f9e]]></PicMd5Sum>
    			</item>
    		</PicList>
    		<Count>2</Count>
    	</SendPicsInfo>
    </xml>
    

    格式化了下,感觉如果微信没做过修改的话,现在的代码确实是有问题的,不过微信的消息格式确实挺恶心的

  2. binarywang commented on Aug 10, 2017

    @binarywang
    Owner

    SendPicsInfo 下面有多个PicList和一个Count,真是醉了

  3. added a commit that references this issue on Aug 14, 2017
  4. binarywang commented on Aug 14, 2017

    @binarywang
    Owner

    临时测试版本2.7.8.BETA已修复

  5. added a commit that references this issue on Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions