<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Rabbaj,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>It seems to me that you are using 2 different
packages. </FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>There is a function called "RosterGet()" in
Net::Jabber::Client. </FONT></DIV>
<DIV><FONT face=Arial size=2>find the sample code in:</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="http://jru.jabberstudio.org/">http://jru.jabberstudio.org/</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>-Yanming</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=rebbaj2000@yahoo.co.uk href="mailto:rebbaj2000@yahoo.co.uk">rebbaj
rebbaj</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=jdev@jabber.org
href="mailto:jdev@jabber.org">jdev@jabber.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, January 07, 2003 9:40
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [JDEV] Proper use of Perl
Net::Jabber calls</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>
<P>Hello jabber people.</P>
<P>I am hoping that someone can help me out with how the Perl Net::Jabber
library should be used. Note that I am also somewhat new to perl so if I
get confused by some of the syntax, you will have to excuse me. The
examples in the Oreily book were rather helpful but I seem to be having
problems in calling and receiving IQ information.</P>
<P>Here is what I am trying to send and receive in XML:</P>
<P>SENT:<BR><iq id="jcl_9" type="get"><BR> <query
xmlns="jabber:iq:roster"/><BR></iq><BR><BR>RECV:<BR><iq <A
href="mailto:from='rebbaj@jabber.org/Perl'">from='rebbaj@jabber.org/Perl'</A>
id='jcl_9' type='result'><BR> <query
xmlns='jabber:iq:roster'><BR> <item <A
href="mailto:jid='rebbaj@jabber.com'">jid='rebbaj@jabber.com'</A>
name='rebbaj' subscription='both'/><BR> <item <A
href="mailto:jid='rebbaj2@jabber.com'">jid='rebbaj2@jabber.com'</A>
name='rebbaj2' subscription='both'/><BR>
</query><BR></iq></P>
<P>The code stub that I have written to do this is as follows. I suspect
that I have the flow a bit wrong and I am not using the optimal calls to parse
the resulting returned roster data... Any help would be
appreciated....</P>
<P>rebbaj</P>
<P>------------------------------------------------<BR>#!/usr/bin/perl<BR>use
Net::Jabber qw(Client);<BR>use strict;<BR>my
$c=Net::Jabber::Client->new();<BR>$c->Connect('hostname'=>
'jabber.org', 'port'=>5222);</P>
<P>$c->AuthSend('username'=> 'rebbaj',<BR>
'password'=> 'secret',<BR> 'resource'=>
'Perl');</P>
<P>$c->SetCallBacks('presence'=>
\&handle_presence);<BR>$c->SetCallBacks('iq'=>
\&handle_iq);<BR>$c->PresenceSend();<BR><BR>My $IQ = new
Net::Jabber::IQ();<BR>$IQ->NewQuery("jabber:iq:roster"); # Does this
actually make the IQ get request?$c->Send($IQ); # is this call
necessary?</P>
<P>print "involking process\n";<BR>$c->Process();</P>
<P><FONT face=Arial size=2></FONT> </P>
<P> </P>
<P><BR>$c->Disconnect;<BR>exit(0);</P>
<P>sub handle_presence {<BR> my ($sid, $presence) = @_;</P>
<P> my $show = $presence->GetShow() ||
'online';<BR> <BR> print "presence packet received
$show\n";<BR>}</P>
<P>sub handle_iq {<BR> my ($sid, $iq) = @_;</P>
<P> my $querytag = $iq->GetQuery();</P>
<P><BR> print "iq packet received $querytag\n";<BR>}</P>
<P>
<P><BR>
<HR SIZE=1>
<A
href="http://uk.yahoo.com/mail/tagline_xtra/?http://uk.docs.yahoo.com/mail_storage.html"><B><FONT
face=Arial size=2>With Yahoo! Mail you can get a bigger mailbox -- choose a
size that fits your needs</FONT></B></A><BR></BLOCKQUOTE></BODY></HTML>