<P>Thanks Yanming. I took a good long look at the code found at <A href="http://www.jabberstudio.org/cgi-bin/viewcvs.cgi/*checkout*/netjabber/examples/client.pl?rev=1.4&content-type=text/plain">http://www.jabberstudio.org/cgi-bin/viewcvs.cgi/*checkout*/netjabber/examples/client.pl?rev=1.4&content-type=text/plain</A>
<P>What I still do not understand is why the $Connection->RosterGet(); call does not result in all of the roster entries being sent back from the server and hence triggering the sub InIQ routine. If I manually enter the following XML "<iq type="get"><query xmlns="jabber:iq:roster"/></iq>, I get all the entries back.
<P>The docs state "RosterGet() - sends an empty Net::Jabber::IQ::Roster tag to the server so the server will send the Roster to the client."
<P>Any other ideas?
<P>Regards,
<P>Rebbaj
<P> <B><I>Yanming Xiao <xiao@legatovideo.com></I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
<STYLE></STYLE>
<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></BLOCKQUOTE><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>