Being new to XMPP and Java (I am iOS dev) by following some tutorial I managed to write a server component (Openfire) and client iOS app (using robbiehanson's ios xmppframeowrk). I could able to send and receive message to and from component <-> iOS client. Here is a abstract code:
Sending presence from iOSclient app to server component:
XMPPPresence *presence = [XMPPPresence presence];
[presence addAttributeWithName:@"to" stringValue:serverComponentJid];
NSXMLElement *someInfo = [NSXMLElement elementWithName:@"someInfo"
stringValue:@"xyz"];
[presence addChild:someInfo];
[_xmppStream sendElement:presence];
Receiving the packet in server component:
if (packet instanceof Presence){
org.xmpp.packet.Presence recvPresence = (Presence) packet;
Element theInfo = recvPresence.getChildElement("someInfo", "***what_shoud_be_the_namespace_here***");
System.out.println("Some info in the presence as " + theInfo.attributeValue("someInfo"));
I can print the packet and see the someInfo. When i pass "" in the namespace then i am able to get it correct which is understandable. However I still dont understand what and how to use namespace in xmpp. Any guide, tut, link, ref or answers please