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

微信的消息回复的FromUserName和ToUserName是不是对调了 #484

Closed
xifat opened this issue Aug 5, 2016 · 3 comments
Closed

微信的消息回复的FromUserName和ToUserName是不是对调了 #484

xifat opened this issue Aug 5, 2016 · 3 comments

Comments

@xifat
Copy link

xifat commented Aug 5, 2016

我用的环境

PHP 版本:
overtrue/wechat 版本: "overtrue/wechat": "~3.1"

微信的消息回复的FromUserName和ToUserName是不是对调了

描述你的问题现象,报错贴截图粘贴或者贴具体信息,提供必要的代码段

`
$server = $this->app->server;

$server->setMessageHandler(function ($message) {
return "您好!欢迎关注我!";
});
$server->serve()->send();

微信debug
<xml> <ToUserName> <![CDATA[o4aeVxBRVSHGy0mHpXvKHVEHTIPE]]> </ToUserName> <FromUserName> <![CDATA[gd_2123132456]]> </FromUserName> <CreateTime>1470360550</CreateTime> <MsgType> <![CDATA[text]]> </MsgType> <Content> <![CDATA[您好!欢迎关注我!]]> </Content> </xml>

另外$server->serve()->send();

Content内容怎么多了 是不是格式不对呢?

@overtrue
Copy link
Collaborator

overtrue commented Aug 5, 2016

要不你有空学习一下 XML?

@overtrue overtrue closed this as completed Aug 5, 2016
@xifat
Copy link
Author

xifat commented Aug 5, 2016

好的,
另外FromUserName 和ToUserName 是否对调了呢,要手动指定么?
$server->serve()->send(); 在微信debug调试上回复的是上面的xml ,导致在微信上没收到消息。
是上面那个xml的格式问题么。我对比了一下Content 多了<![CDATA[ !];

@xifat
Copy link
Author

xifat commented Aug 5, 2016

问题已解决,弄错了!! @overtrue 感谢这么好的应用扩展

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