I would highly appreciate if someone can help me how to recieve iq packets with ASMACK, i am sending raw iq packets but not able to receive it,
I have registered the iq packets programatically before making a connection but still not getting reponse,
pm.addIQProvider("vCard", "vcard-temp", new VCardProvider());
final IQ iq = new IQ() {
public String getChildElementXML() {
return "<iq from='test@XX.XX.XX.XX' id='v1' to='test@XX.XX.XX.XX' type='get'><vCard xmlns='vcard-temp'/></iq>";
}
};
iq.setType(IQ.Type.GET);
connection.sendPacket(iq);
connection.addPacketListener(new MyPacketListener(),new PacketTypeFilter(IQ.class));
First of all, try setting your packet listener before you send the packet. It is an asynchronous protocol and it is possible that the response is being returned before your listener is setup to receive it.
Then try setting -DsmackDebugEnabled=true to check that there is an actual response to your send.