Im looking to get the names of all the conference rooms
on a server and the number of occupants in each room.
I am sending the following packet to my server:
<iq type=’‘get’’ to=’‘conference.hellboy.com’’><query xmlns=’‘jabber:iq:browse’’/>
and it returns back the following(the following output is from the smack debugger)
<iq type=’‘result’’ to=’‘hellboy@localserver/Smack’’ from=’‘conference.hellboy.com’’><item xmlns=’‘jabber:iq:browse’’ category=’‘conference’’ type=’‘public’’ jid=’‘conference.hellboy.com’’ name=’‘Public Chatrooms’’>http://jabber.org/protocol/muchttp://jabber.org/protocol/discojabber:iq:browsejabber:iq:versionjabber:iq:time< ns>jabber:iq:lastvcard-temp<item category=’‘conference’’ type=’‘public’’ jid=’‘work@conference.hellboy.com’’ name=’‘work (1/30)’’/><item category=’‘conference’’ type=’‘public’’ jid=’‘notcool@conference.hellboy.com’’ name=’‘notcool (1/30)’’/><item category=’‘conference’’ type=’‘public’’ jid=’‘thezip@conference.hellboy.com’’ name=’‘thezip (1/30)’’/><item category=’‘conference’’ type=’‘public’’ jid=’‘cool@conference.hellboy.com’’ name=’‘cool (2/30)’’/><item category=’‘conference’’ type=’‘public’’ jid=’‘pizza@conference.hellboy.com’’ name=’‘pizza (2/30)’’/>
my question is how do I access: name=’‘notcool(1/30)’’,
name=’‘cool(2/30)’’ etc…?
I followed all the steps in the post by: bjiggs
Topic: Getting a list of conference rooms
with no luck…
this is the iqProvider im trying to use
conference
jabber:iq:browse
org.jivesoftware.smackx.packet.Browse
and here is Browse class
package org.jivesoftware.smackx.packet;
import org.jivesoftware.smack.packet.IQ;
public class Browse extends IQ
{
private String conference;
/**
- Creates a new instance of Browse
*/
public Browse()
{
setType(IQ.Type.GET);
}
public String getChildElementXML()
{
return null;
}
protected void setConference(String conf)
{
this.conference = conf;
}
protected String getConference()
{
return conference;
}
}
I used a “addPacketListener” grab packets which are
filtered by Type.RESULT and getfrom
all unfiltered packets I print with:
System.out.println("XML: " + iqPacket.toXML() + “\n”);
Here is what the final output is:
for some reason I am missing alot of the raw data
Thanks for your help and time
Scott