Notifications of new leaf items on collection nodes; pubsub#subscription_required error

I have a sub-collection in a collection. When in this sub-collection a leaf node is created I want the user who is subscribed to the top-collection to be notified.

I figured out that the user needs to configure the subscription to the top-collection with the variable “subscriptionDepth = 2” (I see this variable in the database in the “ofPubsubSubscriptions” in openfire table).

But I can’t configure the user’s subscription by sending the following stanzas:

a) I tried configuring the subscription options:

<pubsub xmlns='[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)'>    

<field var='FORM_TYPE' type='hidden'><value>[http://jabber.org/protocol/pubsub#subscribe_options](http://jabber.org/protocol/pubsub#subscribe_options)</value></field>                   

2

This returns:

<pubsub xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)">

  <subscription xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)" node="testCollection" subscription="unconfigured" jid="user@server.local">

    <subscribe-options xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)">

      <required xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)"/>

b) Also tried first subscribing to the collection:

Subscribing to the top-collection returns “unconfigured” which is OK:

    <pubsub xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)">

      <subscription xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)" node="testCollection" subscription="unconfigured" jid="user@server.local">

        <subscribe-options xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)">

          <required xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)"/>

Request Configuration Options:

<iq type='get’to=‘pubsub.server.local’

id=‘options1’>

<pubsub xmlns='[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)'>

Auth Error:

    <pubsub xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)">

      <options xmlns="[http://jabber.org/protocol/pubsub](http://jabber.org/protocol/pubsub)" node="testCollection" jid="user@server.local"/>

I also tried to do the same with node owner without success.