I’m trying to get the hang of using PubSub (and XMPP in general) over BOSH. I can talk and authenticate to the server fine, but when I send a pubsub disco#items stanza (or a create node… haven’t tried anything else) it always returns the disco#info response. This is the first stanza I send after auth success and roster download.
and so on.
Any ideas what I've missed out here? I'm trying to go by the spec and a prayer lol. I can provide more debug output if required.
The ultimate goal here is to have a "System" user that creates/manages nodes through a web interface, then users subscribe to the things the system user publishes.
This is the stanza you require to get the nodes that exist
in the pubsub service. You are not specifying the pubsub
service as the destination for your request.
Any requests for pubsub need to be addressed to the pubsub
service.
No, you shouldn’t have to set anything, the default values should be fine. If anything, you would get errors if the service didn’t exist. I notice that you do not have an id set for your request stanza’s. Are they set before they are sent to the server? They would be required to match the response to the request.
I don’t know how you are sending these stanza’s, but if you can monitor the sent and received raw stanzas this might give you some idea as to what is going wrong.
Luckily I’ve already built in Raw stanza logging immediately before and after the exec is performed, which has helped me get past all the authentication side of things.
Here is where I’m up-to (I’ve commented out the handling of the roster, as it is getting confused between that and the pubsub disco#info response… need to build in a check to see if it is pub-subbing!). Stuff being sent to the server is on the left, stuff it’s got back is on the right. (The logging put in line-breaks every so often so I can read it easier… the stanza’s aren’t being affected by that)
I’ve also tried sending an empty stanza, which also returns the same result.
It feels like I’m missing a fundemental step or attribute and the server isn’t telling me, just returning what it supports (it does seem to recognise it is PubSub though).