Hello,
I am trying to develop an adhoc-command provider to parse adhoc commands (JEP-0050).
A sample command execution request is as follows:
[/code]
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;
}
}
}
/code
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.
Thanks
Message was edited by: slokim
null