powered by Jive Software

Wrong iq message?

Hello,

I’'m trying to receive iq message like :

I have created an FileIQ object which extends from IQ. I also registered this object with

ProviderManager.addIQProvider(“query”, “my:iq:cmd”, FileIQ.class);

I’'m sending and receiving packet with :

Packet pa = new FileIQ();

pa.setTo(to);

pa.setFrom(from);

connection.sendPacket(pa);

// receive iq

PacketCollector collector = connection.createPacketCollector(new PacketTypeFilter(IQ.class));

IQ result = (IQ) collector.nextResult(5000);

if (result != null && result.getType() == IQ.Type.RESULT) {

System.out.println(result.toXML());

}

but the message display by the system.out.println is the one I just sent and not the one I received.

If I use the debug gui, I can see the good received message but I don’'t get it thru smack

I’'m using smack 1.5.0

I have something wrong but I don’‘t know what… Can anyone tell me what’'s wrong ?

Any piece of code or link would be appreciate

I solved my problem. I had a bug in the getChildElementXML() of my FileIQ object and therefore the message I receive had the same content as the one I send…