powered by Jive Software

Display on the service discovery

Hi all.I have wrote the below code for displaying my component on the service discovery dialog of the client.But I failed and do not know where the problem is.

Will anyone give me some opinions?Thanks!

public void processPacket(Packet packet){

if(packet instanceof IQ){

IQ iq = (IQ)packet;

Element childElement = (iq).getChildElement();

String namespace = null;

if(childElement != null){

namespace = childElement.getNamespaceURI();

System.out.println(namespace);

}

        if("http://jabber.org/protocol/disco#info".equals(namespace)){

try{

IQ replyPacket = IQ.createResultIQ(iq);

                Element responseElement = replyPacket.setChildElement("query", "http://jabbe.org/protocol/disco#info");

responseElement.addElement(“identity”).addAttribute(“category”,“conference”).ad dAttribute(“type”,“text”).addAttribute(“name”,“Smooth Session Migration(SSM)”);

responseElement.addElement(“feature”).addAttribute(“var”,“mrbear:SSM:text”);

componentManager.sendPacket(this, replyPacket);

}catch(Exception e){

}

}

}

}