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

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

Closed
xiaohe27 opened this issue Aug 6, 2017 · 3 comments
Closed

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

xiaohe27 opened this issue Aug 6, 2017 · 3 comments

Comments

@xiaohe27
Copy link

xiaohe27 commented Aug 6, 2017

用户拍照或者发图后,后台可以收到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

@binarywang
Copy link
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>

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

@binarywang
Copy link
Owner

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

@binarywang
Copy link
Owner

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

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

No branches or pull requests

2 participants