Hey guys,
I’‘ve installed an IQ handler as a plugin in Wildfire but can’‘t get it to respond to the IQ packets I’'m sending to it. I can tell from the Wildfire logs the handler is installed and initialized. I have some tracing in the handler that shows the handler is constructed, but handleIQ never gets called.
The handler constructer is registered for query packets of the form:
info = new IQHandlerInfo(“query”, “jabber:iq:geo”);[/code]
I’'m sending the IQ packet using Smack as follows, using code copied out of the Smack examples:
// Request the geo information from a remote user.
XMPPConnection con = new XMPPConnection(“XMPPServer”);
GEOIQ geoRequest = new GEOIQ();
geoRequest.setType(IQ.Type.GET);
// Create a packet collector to listen for a response.
PacketCollector collector = con.createPacketCollector(
new PacketIDFilter(geoRequest.getPacketID()));
con.sendPacket(geoRequest);
// Wait up to 5 seconds for a result.
String IP = null;
GEOIQ geoResult = null;
IQ result = (IQ)collector.nextResult(5000);
if (result != null && result.getType() == IQ.Type.RESULT) {
geoResult = (GEOIQ)result;
// Do something with result…
IP = geoResult.getIp();
}[/code]
The query packet created by GEOIQ has the namespace I’‘ve registered GEOIQHandler to handle, jabber:iq:geo. I think I’'m missing something obvious, has anyone else installed an IQ handler as a plugin?
Also, is there any way to trace packets as they’'re sent back and forth from Wildfire?
Thanks!
Jay