您的位置:首页 > Web前端

文章标题

2016-08-19 16:12 232 查看
openfire 发送文件出现error code=406,经过半天仔细查找发现是SI少了一个ID导致的,

SEND: <iq to="vms3@www.ntcipvmssystem.com/Spark" type="set" from="oliver@www.ntcipvmssystem.com/agsXMPP" id="Int32"><open xmlns="http://jabber.org/protocol/ibb" block-size="4096" sid="jsi_8075487451974523534" stanza="iq" /></iq>

RECV: <iq xmlns="jabber:client" from="vms3@www.ntcipvmssystem.com/Spark" to="oliver@www.ntcipvmssystem.com/agsXMPP" type="error" id="Int32"><open xmlns="http://jabber.org/protocol/ibb" block-size="4096" stanza="iq" id="jsi_8075487451974523534" />
<error code="406" type="MODIFY"><not-acceptable
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>


原本发送的是

SEND:
<iq id="agsXMPP_9" to="vms3@www.ntcipvmssystem.com/Spark" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" ><file xmlns="http://jabber.org/protocol/si/profile/file-transfer"
name="MAIN.lst" size="6288"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form">
<field type="list-single"
var="stream-method">
<option>
<value>http://jabber.org/protocol/ibb</value>
</option>
</field>
</x>
</feature>
</si>
/iq>


改变为

SEND:
<iq id="agsXMPP_9" to="vms3@www.ntcipvmssystem.com/Spark" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer"
**id="09f9ef97-e408-49d7-b7e1-638ea340d26f"**><file xmlns="http://jabber.org/protocol/si/profile/file-transfer"
name="MAIN.lst" size="6288"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form">
<field type="list-single"
var="stream-method">
<option>
<value>http://jabber.org/protocol/ibb</value>
</option>
</field>
</x>
</feature>
</si>
/iq>


注意 SI里多了个id=”09f9ef97-e408-49d7-b7e1-638ea340d26f”*

这个是文件ID,贯彻发送过程保存不变
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息