I’‘m trying to implement one of the JEPs as an IQ extension. Smack contains some good examples of how to do this, but I can’'t find any uses of how to create an error or result message.
IQ is an abstract class so it’'s not possible to create one (as I saw in an example in this forum) using:
IQ iq = new IQ();
I suppose I could just use an empty IQ of my extension type, but I run into more confusion when I need to send an error.
XMPPError seems like the place to start, but it doesn’‘t include the type attribute or child stanza that seem to be required by the XMPP core. If I create an empty IQ as above and set the type to ERROR, how do I add the XMPPError as a child element? There doesn’'t appear to be a setChild or addChild method on IQ.