[jdev] Accessing the roster from a component

Esteban Manchado Velázquez zoso at demiurgo.org
Wed Jun 4 17:11:08 CDT 2008


Hi,

    I would like to do something that I thought it would be very simple, but I
can't figure out how to do it: I want access to user rosters from a component.
The idea is customising the response to user requests depending (e.g. service
discovery) on the contents of that user's roster.

    I have tried with the examples in the book "Jabber Developer's Handbook"
(both trying with routing and with direct xdb requests), but I only get errors
back. I guess that maybe those requests are outdated (the book is quite old),
but I can't figure out how to do it correctly.

My attempt with routing is:

    <route from='tada.localhost' to='estebanm at localhost/hunter'>
        <iq id='1426' type='get'>
            <query xmlns='jabber:iq:roster'/>
        </iq>
    </route>

and I get this back:

    <route from='estebanm at localhost/hunter' to='tada.localhost' type='error'
           xmlns='jabber:client'>
        <iq id='1426' type='get'>
            <query xmlns='jabber:iq:roster'/>
        </iq>
        <error code='400' type='modify'>
            <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
        </error>
    </route>

My attempt with direct xdb is:

    <xdb from='sessions' id='1225' to='estebanm at localhost' type='get'
         xmlns='jabber:iq:roster'/>

but I get this back:

    <xdb from='estebanm at localhost' to='sessions' id='1225' type='error'
         xmlns='jabber:client'>
        <error code='400' type='modify'>
            <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
        </error>
    </xdb>

So, any ideas? Pointer to component development documentation maybe? I haven't
been able to find much about that.  I am using ejabberd 2 BTW. TIA,

-- 
Esteban Manchado Velázquez <emanchado at demiurgo.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.jabber.org/jdev/attachments/20080605/244006e3/attachment-0002.pgp>


More information about the JDev mailing list