powered by Jive Software

A little confused at this point


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.

Any help would be greatly appreciated.


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.



Ok, I’'ll try

Ok, so I’‘ve found that it’'s actually really easy to register with Yahoo, MSN, and AIM with Smack using the Registration() class…

ICQ is a different story. It sends jabber:x:data form with actually ends up causing a connection abort.

Anyway, just an information post

Ok, maybe you can help me figure out what’'s wrong in this case. I am sending a IQ get to an ICQ transport like this:

<iq id="qDcrf-57" to="icq.netmindz.net" type="get"><query xmlns="jabber:iq:register"></query></iq>

and I recieve a packet like this:

<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.



Thanks a bunch Matt

Hi Adam:

Can you share the code how to register a service(Yahoo, MSN, ICQ) by using Registration class?