2

我正在尝试ejabberd基于BOSH Manager. pubsub model但是当我尝试做同样的事情时,我得到了feature-not-implemented错误。我真的不知道这背后的原因是什么。

出于隐私原因,我已将实际域名替换为example.com

这是我从创建->发送配置->接收响应的整个节工作流程。

1)创建从客户端发送的节点

<body rid='2941054258' xmlns='http://jabber.org/protocol/httpbind' sid='79a157493e8d93a93949c358bd71bc394499bebd'>
    <presence xmlns='jabber:client'>
        <priority>-1</priority>
    </presence>
    <iq to='pubsub.example.com' type='set' xmlns='jabber:client' id='5224:sendIQ'>
    <pubsub xmlns='http://jabber.org/protocol/pubsub'>
        <create node='news'/>
    </pubsub>
    </iq>
</body>

2)从服务器创建节点接收

<body xmlns='http://jabber.org/protocol/httpbind'>
    <presence xmlns='jabber:client' from='hunty@example.com/4529683821343890277773299' to='niharb@example.com/6976111021343894644477923'>
        <priority>-1</priority>
        <delay xmlns='urn:xmpp:delay' from='hunty@example.com/4529683821343890277773299' stamp='2012-08-02T06:51:19Z'>
        </delay>
    <x xmlns='jabber:x:delay' stamp='20120802T06:51:19'/>
    </presence>
    <presence xmlns='jabber:client' from='niharb@example.com/6976111021343894644477923' to='niharb@example.com/6976111021343894644477923'>
        <priority>-1</priority>
    </presence>
    <iq xmlns='jabber:client' from='pubsub.example.com' to='niharb@example.com/6976111021343894644477923' id='5224:sendIQ' type='result'>
    <pubsub xmlns='http://jabber.org/protocol/pubsub'>
        <create node='news'/>
    </pubsub>
    </iq>
</body>

3) 将配置发送到服务器

<body rid='2941054259' xmlns='http://jabber.org/protocol/httpbind' sid='79a157493e8d93a93949c358bd71bc394499bebd'>
    <iq to='pubsub.example.com' type='set' xmlns='jabber:client' id='5225:sendIQ'>
        <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
            <configure node='news'>
            <x xmlns='jabber:x:data' type='submit'>
                <field var='FORM_TYPE' type='hidden'>
                    <value>http://jabber.org/protocol/pubsub#node_config</value>
                </field>
                <field var='pubsub#deliver_payloads'>
                    <value>1</value>
                </field>
                <field var='pubsub#send_last_published_item'>
                    <value>never</value>
                </field>
                <field var='pubsub#persist_items'>
                    <value>1</value>
                </field>
                <field var='pubsub#max_items'>
                    <value>20</value>
                </field>
            </x>
            </configure>
        </pubsub>
    </iq>
</body>

4)从服务器返回配置错误功能未实现

<body xmlns='http://jabber.org/protocol/httpbind'>
    <iq xmlns='jabber:client' from='pubsub.example.com' to='niharb@example.com/6976111021343894644477923' type='error' id='5225:sendIQ'>
    <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
    <configure node='news'>
    <x xmlns='jabber:x:data' type='submit'>
        <field var='FORM_TYPE' type='hidden'>
            <value>http://jabber.org/protocol/pubsub#node_config</value>
        </field>
        <field var='pubsub#deliver_payloads'>
            <value>1</value>
        </field>
        <field var='pubsub#send_last_published_item'>
            <value>never</value>
        </field>
        <field var='pubsub#persist_items'>
            <value>1</value>
        </field>
        <field var='pubsub#max_items'>
            <value>20</value>
        </field>
    </x>
    </configure>
    </pubsub>
    <error code='501' type='cancel'>
        <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    </error>
    </iq>
</body>
4

0 回答 0