January 2002
Beginner
480 pages
13h 15m
English
By browsing a service, we can tell whether it supports the
jabber:iq:gateway utility:
SEND: <iq type="get" id="aim1" to='aim.jabber.org'>
<query xmlns="jabber:iq:browse"/>
</iq>
RECV: <iq type='result' id='aim1' to='qmacro@jabber.org/winjab'
from='aim.jabber.org'>
<service xmlns='jabber:iq:browse' type='jabber'
jid='aim.jabber.org' name='AIM Transport'>
<ns>jabber:iq:register</ns>
<ns>jabber:iq:gateway</ns>
</service>
</iq>
We can now avail ourselves of this utility, to convert an AIM screen name
test ScreenName to the equivalent JID to be used
(in relation to the AIM Transport service) in a Jabber context:
SEND: <iq type='get' to='aim.jabber.org' id='conv5'>
<query xmlns='jabber:iq:gateway'/>
</iq>
RECV: <iq type='result' to='qmacro@jabber.org/hailsham' id='conv5'
from='aim.jabber.org'>
<query xmlns='jabber:iq:gateway'>
<desc>Enter the user's screen name</desc>
<prompt/>
</query>
</iq>
We can reply, with an IQ-set, with our screen name:
SEND: <iq type='set' to='aim.jabber.org' id='conf6'>
<query xmlns='jabber:iq:gateway'>
<prompt>test ScreenName</prompt>
</query>
</iq>
and receive the result of the transport-specific JID conversion:
RECV: <iq type='result' to='qmacro@jabber.org/Work' id='conf6'
from='aim.jabber.org'>
<query xmlns='jabber:iq:gateway'>
<prompt>testScreenName@aim.jabber.org</prompt>
</query>
</iq>
Read now
Unlock full access