powered by Jive Software

sendPacket doesn''t work

I try to send an XML string from a java program with sendPacket(), but nothing arrives at the user i send to. Here the source:

con = new XMPPConnection(“jabber.freenet.de”);

con.login(“", "”);

IQ iqpacket=null;

iqpacket = new IQ() { public String getChildElementXML() { return XMLString; } public String toXML() { return XMLString; } };

iqpacket.setType(IQ.Type.SET);

        iqpacket.setTo("***@jabber.freenet.de");

con.sendPacket(iqpacket);

I have no idea what i am doing wrong.

Thanks for help!

I’'m having the same issue. Enable debugging by putting the following before you do anything:

org.jivesoftware.smack.XMPPConnection.DEBUG_ENABLED = true;

And if you monitor the RECEIVED tab, you’‘ll probably getting back error packets from the server. I keep getting code 503 errors, which I’'m trying to decipher at the moment.

Delving a little deeper, another reason is that you need a full JID. The following post explains this:

http://www.jivesoftware.org/forums/thread.jspa?messageID=92492

Thank you, now it’'s working!