折腾:
期间,
改为:
当前测试用户2,先发送Presence到服务器:
<presence from="[email protected]/user-e448856d-eff7-4e05-a391-fd6179cb7382" to="[email protected]"> <x xmlns="http://jabber.org/protocol/muc"/> </presence> |
但是还是返回说到出了错的presence:
<presence from="[email protected]" to="[email protected]/5a87e0fa" type="error" xmlns="jabber:client"> <x xmlns="http://jabber.org/protocol/muc"/> <error code="400" type="modify"> <jid-malformed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> </error> </presence> |
【解决过程】
搜:
xmpp error code 400 type modify jid-malformed
xmpp MUC error code 400 type modify jid-malformed
Bug 33988 – Attempts to join rooms using illegal JIDs
jid-malformed error in XMPP component
后来调试又很诡异:
发送了给group加了组名的presence:
<presence from="[email protected]/user-e448856d-eff7-4e05-a391-fd6179cb7382" to="[email protected]/All"><x xmlns="http://jabber.org/protocol/muc"/></presence> |
但是却出了406的错(而不是之前的400错误了):
<presence xmlns="jabber:client" from="[email protected]/All" to="[email protected]/263985f" type="error"><x xmlns="http://jabber.org/protocol/muc"/><error code="406" type="modify"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></presence> |
最后改为:
即:
1.id是可以不用加的
2.group后面不是group的nickname,而是用户的userId
发送:
<presence from="[email protected]" to="[email protected]/user-e448856d-eff7-4e05-a391-fd6179cb7382"> <x xmlns="http://jabber.org/protocol/muc"/> </presence> |
才得到正确回复:
<presence xmlns="jabber:client" from="[email protected]/user-e448856d-eff7-4e05-a391-fd6179cb7382" to="[email protected]/e8dbe2ce"> <x xmlns="http://jabber.org/protocol/muc#user"> <item jid="[email protected]/e8dbe2ce" affiliation="member" role="participant"/> </x> </presence> |
转载请注明:在路上 » 【已解决】XMPP出错:code 400 jid-malformed xmlns urn:ietf:params:xml:ns:xmpp-stanzas