i sent the following stanza to ejabbers server after creating a node "test1_node1"
<iq id="publish1" to="pubsub.oomaxmpp.com" type="get" from="admin#oomaxmpp.com/1697575709134613774110793">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="test_node1"><item id="qwert12345">
<entry xmlns="http://www.w3.org/2005/Atom">
<title>*publish*</title>
<summary>*1234567890*</summary>
<published>2003-12-13T18:30:02Z</published>
<updated>2003-12-13T18:30:02Z</updated>
</entry>
</item>
</publish>
</pubsub>
</iq>
but i get an error result with following stanza,
<iq id="publish1" xml:lang="en" type="error" to="admin#oomaxmpp.com/1697575709134613774110793" from="pubsub.oomaxmpp.com">
<pubsub xmlns="http://jabber.org/protocol/pubsub"><publish node="test_node1">
<item id="qwert12345"><entry xmlns="http://www.w3.org/2005/Atom">
<title>*publish*</title>
<summary>*1234567890*</summary>
<published>2003-12-13T18:30:02Z</published>
<updated>2003-12-13T18:30:02Z</updated>
</entry>
</item>
</publish>
</pubsub>
<error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
i dont understand,if feature was not implemented how nodes were created?
Why cant i publish?
Related
I'm working on developing an XMPP Client communicating over an ejabberd community server (version 17.09) that we host ourselves.
I'm having trouble to implement the MucSub Feature (supported since version 16.08 as far as I know).
When I'm sending this XML command (described in the ejabberd documentation for subscribing to a chatroom):
<iq from='hag66#shakespeare.example'
to='coven#muc.shakespeare.example'
type='set'
id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
<subscribe xmlns='urn:xmpp:mucsub:0'
nick='mynick'
password='roompassword'>
<event node='urn:xmpp:mucsub:nodes:messages' />
<event node='urn:xmpp:mucsub:nodes:affiliations' />
<event node='urn:xmpp:mucsub:nodes:subject' />
<event node='urn:xmpp:mucsub:nodes:config' />
</subscribe>
</iq>
(of course entering existing jid's for this server, allow_subscription set to true for this chatroom) I get the result:
<iq xml:lang='de'
to='hag66#shakespeare.example'
from='coven#muc.shakespeare.example'
type='error' id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
<subscribe xmlns='urn:xmpp:mucsub:0' nick='mynick'>
<event node='urn:xmpp:mucsub:nodes:messages'/>
<event node='urn:xmpp:mucsub:nodes:affiliations'/>
<event node='urn:xmpp:mucsub:nodes:subject'/>
<event node='urn:xmpp:mucsub:nodes:config'/>
</subscribe>
<error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xml:lang='de' xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>No module is handling this query</text>
</error>
</iq>
When I alter the query to:
<iq from='hag66#shakespeare.example'
to='coven#muc.shakespeare.example'
type='set'
id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
<subscribe xmlns='urn:xmpp:mucsub:0'
nick='mynick'
password='roompassword'>
<event xmlns="http://jabber.org/protocol/pubsub#event" node="urn:xmpp:mucsub:nodes:messages" />
<event xmlns="http://jabber.org/protocol/pubsub#event" node="urn:xmpp:mucsub:nodes:affiliations' />
<event xmlns="http://jabber.org/protocol/pubsub#event" node="urn:xmpp:mucsub:nodes:subject' />
<event xmlns="http://jabber.org/protocol/pubsub#event" node="urn:xmpp:mucsub:nodes:config' />
</subscribe>
</iq>
I get the result:
<iq xmlns="jabber:client"
to="hag66#shakespeare.example"
xml:lang="en"
type="result"
from="coven#muc.shakespeare.example"
id="agsXMPP_8">
<subscribe xmlns="urn:xmpp:mucsub:0" nick="mynick" />
</iq>
which I interpret as the query being successfull. Also when I query the Chatrooms this user is subscribed to the chatroom is listed.
My Problem now is: no matter which of this methods I use, the user does not get notifications for messages in that chat if he is not present in exactly this chatroom.
Now the strangest thing is: if I get DiscoInfo from the server the MucSub Feature (urn:xmpp:mucsub:0) is not listed, which I don't understand as the Feature is supported by the server version I'm using and according to the documentation is enabled by default and can't even be disabled.
Has anyone experienced the same issue and/or knows how to resolve it?
Thanks in advance for your help
So finally we found the issue:
instead of sending the request to "coven#muc.shakespeare.example" we were sending it to "coven#shakespeare.example" which didn't work and was forgotten to change in the questions text
I'm 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.
For this I am setting the "pubsub#deliver_payloads" configuration option to true, but when posting items to the node, I get an error. Here are the details of what I'm doing:
First I create the node:
<body rid='614709033' xmlns='http://jabber.org/protocol/httpbind' sid='515c16e0'>
<iq to='pubsub.myserver' type='set' xmlns='jabber:client' id='2:sendIQ'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<create node='mynode'/>
</pubsub>
</iq>
</body>
The server replies saying that it's ok:
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xmlns="jabber:client" type="result" id="2:sendIQ" from="pubsub.myserver" to="user#myserver/515c16e0"/>
</body>
Then I configure the node setting the "pubsub#deliver_payloads" option to "true", in this way:
<body rid='614709036' xmlns='http://jabber.org/protocol/httpbind' sid='515c16e0'>
<iq from='user#myserver' to='pubsub.myserver' type='set' xmlns='jabber:client' id='4:sendIQ'>
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
<configure node='mynode'>
<x xmlns='jabber:x:data' type='submit'>
<field var='pubsub#deliver_payloads'>
<value>true</value>
</field>
</x>
</configure>
</pubsub>
</iq>
</body>
The server replies successfully:
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xmlns="jabber:client" type="result" id="4:sendIQ" from="pubsub.myserver" to="user#myserver/515c16e0"/>
</body>
But when I try to post some data onto that node, like this:
<body rid='614709038' xmlns='http://jabber.org/protocol/httpbind' sid='515c16e0'>
<iq type='set' to='pubsub.myserver' xmlns='jabber:client' id='5:sendIQ'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='mynode'>
<item id='test'>
<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
<lat>0.55</lat>
<lon>1.66</lon>
<timestamp>2014-04-02T15:14:58.783Z</timestamp>
</geoloc>
</item>
</publish>
</pubsub>
</iq>
</body>
The server replies with this error:
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xmlns="jabber:client" type="error" id="5:sendIQ" from="pubsub.myserver" to="user#myserver/515c16e0">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="mynode">
<item id="test">
<geoloc xmlns="http://jabber.org/protocol/geoloc" xml:lang="en">
<lat>0.55</lat>
<lon>1.66</lon>
<timestamp>2014-04-02T15:14:58.783Z</timestamp>
</geoloc>
</item>
</publish>
</pubsub>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<item-forbidden xmlns="http://jabber.org/protocol/pubsub#errors"/>
</error>
</iq>
</body>
I'm using Openfire 3.9.1 as a server, while on the client side I'm using javascript and the Strophe library.
Can anyone explain me why I get this error?
I tried to use different configurations on the node, and when I omit the "pubsub#deliver_payloads" option I get no errors while posting items to the node...
All error conditions are explained in XEP-0060: Publish-Subscribe. You can find the item-forbidden error message at 7.1.3.6 Request Does Not Match Configuration, where it reads:
If the event type is notification + transient and the publisher
provides an item, the service MUST bounce the publication request with
a error and a pubsub-specific error condition of
.
Ok, I see, having only the option "pubsub#deliver_payloads" in the configuration the node is considered a "transient node" (no items allowed).
However, if I change the configuration to make the node "persistent" (i.e. adding the "pubsub#persist_items" and setting it to true), the server should not complain, according to 4.3 Event Types of the XEP-0060, Table 4.
But with this configuration:
<iq from='user#myserver' to='pubsub.myserver' type='set' xmlns='jabber:client' id='5:sendIQ'>
<pubsub xmlns='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>
</iq>
if I try to post an item to the node I still get the same error:
<iq xmlns="jabber:client" type="error" id="13:sendIQ" from="pubsub.myserver" to="user#myserver/2b35c426">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="mynode">
<item id="test">
<geoloc xmlns="http://jabber.org/protocol/geoloc" xml:lang="en">
<lat>0.55</lat>
<lon>1.66</lon>
<timestamp>2014-04-03T08:50:48.682Z</timestamp>
</geoloc>
</item>
</publish>
</pubsub>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<item-forbidden xmlns="http://jabber.org/protocol/pubsub#errors"/>
</error>
</iq>
I solved the problem by simply chenging the value in the configuration from "true" to "1". Actually while reading the XEP-0060 specifications, both "true" - "false" and "1" - "0" values are used in configuration examples. However, in the form that the Openfire server sends me when I ask to configure the node, only "1" - "0" values are used.
With the following configuration all works fine:
<iq from='user#myserver' to='pubsub.myserver' type='set' xmlns='jabber:client' id='5:sendIQ'>
<pubsub xmlns='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>
</configure>
</pubsub>
</iq>
I am trying to mimic the XMPP stream to connect to the google talk servers.
I am however facing a problem when sending the session IQ:
The problem: I don't receive a response from the server in any way after sending this:
<iq id="skcevhxmpp_ceschool#gmail.com_6" type="set" to="gmail.com"><session xmlns="urn:ietf:params:xml:ns:xmpp-session" /></iq>
This is the complete flow:
<stream:stream to='gmail.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>**
<stream:stream from="gmail.com" id="7FB5653900A7A245" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
<stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-OAUTH2</mechanism><mechanism>X-GOOGLE-TOKEN</mechanism></mechanisms></stream:features>
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
<proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
<stream:stream to='gmail.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
<stream:stream from="gmail.com" id="508024A63664BA3D" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
<stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-OAUTH2</mechanism><mechanism>X-GOOGLE-TOKEN</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
<auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">{Valid auth token}</auth>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
<stream:stream to='gmail.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
<stream:stream from="gmail.com" id="A407B98F76E98F73" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
<stream:features><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features>
<iq id="skcevhxmpp_ceschool#gmail.com_5" type="set"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>xmpp</resource></bind></iq>
<iq id="skcevhxmpp_ceschool#gmail.com_5" type="result"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>ceschool#gmail.com/xmppFC762B4C</jid></bind></iq>
<iq id="skcevhxmpp_ceschool#gmail.com_6" type="set" to="gmail.com"><session xmlns="urn:ietf:params:xml:ns:xmpp-session" /></iq>
Extra information:
I use the PLAIN authentication (see:
https://developers.google.com/cloud-print/docs/rawxmpp)
I start using the SslStream after I receive the proceed ... xmpp tls
I use the google talk server to send the xmpp messages to (talk.google.com)
The expected response would be something like:
<iq xmlns="jabber:client" from="gmail.com" type="result" id="skcevhxmpp_ceschool#gmail.com_6" />
Thanks in advance!
try to send the session iq without the to attribute.
<iq id="abcd" type="set">
<session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
</iq>
I am using libstrophe C library to Create xmpp clint.I am successfully able to create node(open node) and send request for subscription from other users,which get added.
Now when i try to publish,using the following stanza,
<iq type='set'
from='hamlet#pratik.com/blogbot'
to='pubsub.pratik.com'
id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='pratik'>
<item id='123456'>
<entry xmlns='http://www.w3.org/2005/Atom'>
<title>Soliloquy</title>
<summary>
To be, or not to be
</summary>
</entry>
</item>
</publish>
</pubsub>
I get,
<error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error>
Any suggestions?
am using ejabberd as server
We create an app that uses XMPP protocol. Initially we started development and used some XMPP server for debug. That was Ok, and we managed to prevent redundant avatar loading by storing graphic files locally and checking the file hash while receiving user Presence update.
But now we switched to new Openfilre server and it keeps sending us all available user avatars not only when we request VCard but also using some message immediately after our user logs in:
<message id="ca82demo01#fffchat__jason#fffchat__jBUhd" to="jason#fffhat/FFFChat" from="ca82demo01#fffchat">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="urn:xmpp:avatar:data">
<item id="66d0dee0216e5466fe17403f1da16aa39d4e1698">
<data xmlns="urn:xmpp:avatar:data">... SOME BIG CHUNK OF DATA ...</data>
</item>
</items>
</event>
<delay xmlns="urn:xmpp:delay" stamp="2012-03-16T00:00:32.298Z"/>
<addresses xmlns="http://jabber.org/protocol/address">
<address jid="ca82demo01#fffchat/53bf00a8" type="replyto"/>
</addresses>
</message>
It keeps me wonder what exact outgoing message requests it from Openfire? Or is it just Openfire server configured to always send us all the avatar graphics for entire roster?
How can this be resolved so we won't have this redundant traffic?
Just in case, these are outgoing messages:
<stream:stream to="fffchat.openfire.local" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
<?xml version="1.0"?>
<stream:stream to="fffchat.openfire.local" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
<auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
<response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Imphc29uIixyZWFsbT0icHBpY2hhdCIsbm9uY2U9ImVhcGVpTlNFZ3NOZzRXRFlsVC9zd1cyLzVWbzMzQWlsYzRvZWFRRFIiLGNub25jZT0iMDBERUFEQkVF
<auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">AGphc29uAGFiYzEyMw==</auth>
<?xml version="1.0"?>
<stream:stream to="fffchat.openfire.local" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
<iq id="_xmpp_bind1" type="set"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>PPIChat</resource></bind></iq>
<iq id="_xmpp_session1" type="set"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
<iq id="roster1" type="get"><query xmlns="jabber:iq:roster"/></iq>
<presence><show>chat</show><status>online</status><x xmlns="vcard-temp:x:update"><photo>16286eb46a54fb48d70dc4fbd548bcd16f78cd34</photo></x></presence>
<iq type="get"><query xmlns="jabber:iq:private"><ppidata xmlns="ppi:userdata:favorites"/></query></iq>
It looks like you were trying to use XEP-0084, messed it up, then switched to XEP-0153. You likely explicitly subscribed to changes to one or more peoples' avatars on your test account, rather than implementing XEP-0163 correctly, which can be quite confusing at first. Easiest fix is to just use a different account. If you want to clean it up, send XEP-0060 unsubscribe protocol in response to each publish that you get:
<iq type='set'
from='jason#fffhat/FFFChat'
to='ca82demo01#fffchat'
id='unsub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<unsubscribe
node='urn:xmpp:avatar:data'
jid='jason#fffhat'/>
</pubsub>
</iq>