Item-forbidden error posting items to Publish-Subscribe node: XEP-0060 specs violated?

Hi,

I was trying to set up an XMPP Publish-Subscribe node and to configure it such that when new items are posted to the node, the payload gets automatically delivered to all the subscribers. I tried to configure the node like this:

<pubsub xmlns='[http://jabber.org/protocol/pubsub#owner](http://jabber.org/protocol/pubsub#owner)'> <configure node='mynode'> <x xmlns='jabber:x:data' type='submit'> <field var='pubsub#persist_items'> <value>true</value> </field> <field var='pubsub#deliver_payloads'> <value>true</value> </field> </x> </configure> </pubsub>

But if I then try to post an item to the node, I get an item-forbidden error:

<error code="400" type="modify"> <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> <item-forbidden xmlns="[http://jabber.org/protocol/pubsub#errors](http://jabber.org/protocol/pubsub#errors)"/> </error>

However, if instead of using “true” I use “1” in the configuration, I get no errors:

<pubsub xmlns='[http://jabber.org/protocol/pubsub#owner](http://jabber.org/protocol/pubsub#owner)'> <configure node='mynode'> <x xmlns='jabber:x:data' type='submit'> <field var='pubsub#persist_items'> <value>1</value> </field> <field var='pubsub#deliver_payloads'> <value>1</value> </field> </x>

``

</pubsub>

XEP-0060 clarifies that “implementations MUST support both styles of lexical representation” xmpp.org/extensions/xep-0060.html#nt-id183715.

Why am I getting an “item-forbidden” error if I user “true” in the configuration?

Thanks

It’s likely a bug in Openfire. I’ve found this in the sources:

if (“pubsub#persist_items”.equals(field.getVariable())) {

values = field.getValues();

booleanValue = (values.size() > 0 ? values.get(0) : “1”);

persistPublishedItems = “1”.equals(booleanValue);

}

OF-785

Using Openfire 4.2.3 and a client based on Smack 4.3.0, this still occurs to be a problem.

Smack is transforming a Boolean Field value to a textual true, whereas OpenFire only accepts ‘1’ as a correct value for true.

I did research the code, but only found code which should test on both situation (‘true’/‘1’) so it is a mystery for me why this is not working.