I’'ve got JBother working as a simple instant messenger pretty well (at least I think). I want to move on and make it so I can browse services and register for them as well. I really have no idea where to start using smack.
I would like to know how I might go about registering for a service first, and then maybe browsing… but the whole idea is really confusing to me.
What do you mean by browsing for services and registering them? Are you talking about transports? If so, you’‘ll have to do some custom coding Smack doesn’'t provide an support for transport browsing.
<iq type=''result'' to=''synic@jabber.org/laptop'' id=''qDcrf-57'' from=''icq.netmindz.net''><query xmlns=''jabber:iq:register''><username/><password/>
<instructions>Please enter your UIN and password</instructions><key>79acc1747de7606da730d9dc40815215c3a8f6dd</key><x xmlns=''jabber:x:data'' type=''form''><title>Registration to ICQ by JIT</title><instructions>Please enter your UIN and password</instructions>
<
If you notice, that last packet is incomplete… but that’‘s as far as it gets before I get a connection error in my connection listener. Here’'s the stack trace:
org.xmlpull.v1.XmlPullParserException: parser must be on START_TAG or TEXT to read text (position: START_TAG seen ...<x xmlns=\''jabber:x:data\'' type=\''form\''><title>... @1:181155) at org.xmlpull.mxp1.MXParser.nextText(MXParser.java:1115)
at org.jivesoftware.smack.PacketReader.parseRegistration(PacketReader.java:495)
at org.jivesoftware.smack.PacketReader.parseIQ(PacketReader.java:373)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:258)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:77)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:103)
Any ideas on why this would be happening? It happens without fail.
It looks like we may need to change how the XML parsing of registration packets works. The use of x:data is what’‘s probably causing the problems since Smack wouldn’'t see that as a normal packet extension. I should be able to get this fixed for the next release.