I have an XMPP application where two clients interact (1) a bot programmed with Smack (Scala/Java) and (2) a GUI chat client programmed in strophe (Javascript).
The app needs to exchange custom XML (e.g., as shown below)
<myPacket>
<response type='sensorData'>
<temperature units='Kelvin'>
234
</temperature>
</response>
</myPacket>
What is the best way to exchange data? The following are what I could come up with:
1) Write custom XMPP stanzas
2) Embed my XML in currently defined stanzas (e.g, in message or iq)
3) For smack, use the Message.get(set)Property
to read/write custom data.
No. 3) is ruled out because it requires that both clients understand Java objects and use the same library (Smack).
Kindly point me to any other questions addressing the same issue.
[EDIT:] After doing some research, I found that Dataforms (XEP-0004) is the easiest way to do it, provided your library supports it.