Reputation: 1885
I'm making IQ requests for saving some data. In order to be synced with ejabberd server, I save IQ data to SQLite database in case of failure. So I convert IQ object to String by iqObject.toXML().toString()
. But I'm stuck When I read from database and convert into IQ class.
My question is: How to convert following String to IQ class?
<iq type='set' id='1001'>
<query xmlns='urn:xmpp:contacts' clean="false" domain='localhost'>
<add>
<i id="1" number="+90">Mesut</i>
<i id="2" number="+91">Umit</i>
<i id="3" number="unknown">Unknown</i>
</add>
<delete>
<i id="4" />
<i id="5" />
</delete>
</query>
</iq>
Any helps would be very appreciated.
Best regards...
The problem is not related with neighter ejabberd nor openfire. It is exactly related with Smack
Atention please, the problem is not sending or receiving IQ packets. I make these works successfully. My question is how to send the String above over Smack as IQ stanza packet, so that receive appropriate IQ response.
Upvotes: 0
Views: 89
Reputation: 1
You approach is true to convert that IQ object into XML, then String.
First you need to go through with the official document of ejabberd server website: https://www.ejabberd.im/IQ%20handlers/index.html
Now, you have to understand how IQ object raw packet are receiving in this thread: https://discourse.igniterealtime.org/t/how-can-i-create-send-and-receive-raw-iq-packet/71540
Upvotes: 0