0
votes

I am trying create a node in ejabber using XMPP and BOSH Manager. But I want to know what values need to be passed in a create node stanza.

Following is the format of create node stanza but i am not be able to create it so can anyone tell me what values need to be passed in <formvalue> <tovalue> <nodevalue>

<iq type='set'
    from='<fromvalue>'
    to='<tovalue>'
    id='create1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <create node='<nodevalue>'/>
  </pubsub>
</iq>

Note: I am using ejabbered and BOSH url is http://example.com:5280/xmpp-http-bind.

i tried this and i am getting feature-not-implemented error

<body rid='95507820' xmlns='http://jabber.org/protocol/httpbind' sid='5c4fbfe432babab58fe5e39367fc1704c06ddfd7'>
   <presence xmlns='jabber:client'>
      <priority>-1</priority>
   </presence>
<iq to='example.com' type='set' xmlns='jabber:client' id='3742:sendIQ'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <create/>
     <configure/>
  </pubsub>
</iq>
</body>

i tried another way too and in that case i am getting creation failed with jid-malformed

<body rid='2037203608' xmlns='http://jabber.org/protocol/httpbind' sid='2a198251db476ef0490a4d3f591468b69edaf35b'>
   <presence xmlns='jabber:client'>
     <priority>-1</priority>
   </presence>
<iq to='example.com' type='set' xmlns='jabber:client' id='7398:sendIQ'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <create node='draw'/>
  </pubsub>
 </iq>

i tried with filepath too but i am getting creation failed with forbidden

<body rid='358865391' xmlns='http://jabber.org/protocol/httpbind' sid='0f7cf72754f0fc3b0b04c8c0bb488e816380d741'>
    <presence xmlns='jabber:client'>
        <priority>-1</priority>
    </presence>
    <iq to='pubsub.example.com' type='set' xmlns='jabber:client' id='8556:sendIQ'>
        <pubsub xmlns='http://jabber.org/protocol/pubsub'>
            <create node='/home/localhost/john/draw/'/>
        </pubsub>
    </iq>
</body>
1

1 Answers

2
votes

Well, for a start here's the relevant documentation.

  • from is the jid of the user sending the iq, as is always the case when sending an iq.
  • to is the Publish-Subscribe service you want to create the node to. A typical value would be pubsub.example.com but that really depends on your server's configuration.
  • node takes the id of the node you create. In some server configurations this has a semantic meaning (typically a path) but try out with mynode for instance.

It is possible that the user sending the iq is not allowed to create the node, or that the service does not support it. One could only tell depending on the error stanza if any, so if the above does not work, do post the error you get.