1
下面顯示我建議發佈到節點稱之爲「ghost2」發佈訂閱發佈到節點的成功,從節點檢索失敗
iq id="kB8dk-0" to="computer/2c10ee6b" type="result"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>[email protected]/Smack</jid></bind></iq>
<iq id="kB8dk-1" to="[email protected]/Smack" type="result"></iq>
<iq id="kB8dk-2" to="[email protected]/Smack" type="result"><query xmlns="jabber:iq:roster"><item jid="test" name="test" subscription="none"></item><item jid="[email protected]" subscription="from"></item></query></iq>
<message id="[email protected][email protected]__ChWrY" to="[email protected]" from="[email protected]"><event xmlns='http://jabber.org/protocol/pubsub#event'><items node='null'><item id='ghost2'/></items></event></message>
<iq id="kB8dk-4" to="[email protected]/Smack" from="computer" type="result"></iq>
<iq id="kB8dk-5" to="[email protected]/Smack" from="computer" type="result"></iq>
<message id="[email protected]__DGaLS" to="[email protected]" from="[email protected]"><event xmlns='http://jabber.org/protocol/pubsub#event'><items node='ghost2'><item id='testid2'><book xmlns="pubsub:test:book"><title>book x</title></book></item></items></event></message>
但是當我嘗試subsript,並從同一節點檢索,我得到錯誤404
<iq id="zpWDI-0" to="computer/b7fe68a8" type="result"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>[email protected]/Smack</jid></bind></iq>
<iq id="zpWDI-1" to="[email protected]/Smack" type="result"></iq>
<iq id="zpWDI-2" to="[email protected]/Smack" type="result"><query xmlns="jabber:iq:roster"><item jid="[email protected]" name="test" subscription="to"><group>Friends</group></item><item jid="test" name="test" subscription="none"></item></query></iq>
<presence id="kB8dk-3" to="[email protected]/Smack" from="[email protected]/Smack"></presence>
<message id="[email protected][email protected]__tAVfB" to="[email protected]/Smack" from="[email protected]"><event xmlns='http://jabber.org/protocol/pubsub#event'><items node='TestNode2323'><item id='2Ke42PVQ77iSCP0'><book xmlns="pubsub:test:book"><title>book x</title></book></item></items></event><x xmlns="jabber:x:delay" stamp="20091013T14:16:32"></x><addresses xmlns="http://jabber.org/protocol/address"><address type="replyto" jid="[email protected]/god"/></addresses></message>
<iq id="zpWDI-4" to="[email protected]/Smack" from="computer" type="error"><query xmlns="http://jabber.org/protocol/disco#info" node="ghost2"></query><error code="404" type="CANCEL"><item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
我想你可能已經刪除了可讀性,例如一些消息因爲你的意思是他們不相關。但正如您對最後一個問題的評論中所提到的那樣:您用於pubsub的庫是什麼庫?我也使用pubsub,但從來不必擔心原始消息。 – sfussenegger 2009-10-15 06:45:19
即時通訊使用smackx pubsub。您? – cometta 2009-10-15 12:08:00
也從響應中,「book x」是來自節點「TestNode2323」..你能評論嗎? – cometta 2009-10-15 12:13:28