powered by Jive Software

AdhocCommandProvider - parsing Adhoc commands


I am trying to develop an adhoc-command provider to parse adhoc commands (JEP-0050).

A sample command execution request is as follows:


I can successfully receive the IQ message, however, I am unable to retrieve the value of node and action. The following is the parseIQ function of my AdhocProvider class:

public IQ parseIQ(XmlPullParser parser) throws Exception {

String node = “”;

String action = “”;

boolean done = false;

while (!done) {

int eventType = parser.next();

if (eventType == XmlPullParser.START_TAG) {

if (parser.getName().equals(“command”)) {

action = parser.getAttributeValue("",“action”);

node = parser.getAttributeValue("",“node”);


} else if (eventType == XmlPullParser.END_TAG) {

if (parser.getName().equals(“iq”)) {

done = true;





I am unable to retrieve the value of “action” and “node”, since the [if (parser.getName().equals(“command”))] statement is never equal to TRUE. What am i doing wrong?

Any guidance would he highly appreciated.


Message was edited by: slokim


I forgot to mention that the IQ provider is registered this way:

ProviderManager.addIQProvider(“command”, “http://jabber.org/protocol/commands”, new AdhocProvider());


Please, any help would be appreciated, this thing is driving me crazy.