[JDEV] More on JUD register function

DJ Adams dj.adams at pobox.com
Wed Nov 7 02:27:20 CST 2001


On Wed, Nov 07, 2001 at 03:43:11PM +0800, Migs Paraz wrote:
> Hi,
> Thanks to DJ, I have made some progress in my JUD component written in Perl.
> 
> The problem for now is how to report the error message if registration failed.
> 
> Both of these didn't work - Gabber just said it failed, but showed no error.
> 
> SEND: <iq id='A68' to='baloney at localhost/Gabber' from='jud.localhost' type='error'><error>My Error.</error></iq>
> 
> SEND: <iq id='A68' to='baloney at localhost/Gabber' from='jud.localhost' type='error'><query xmlns='jabber:iq:register><error>My Error.</error></query></iq>
> 

You're not specifying a complete <error/> tag, and in the second example, 
your <error/> tag is within the <query/> tag, where it doesn't belong.
Based on what you're trying to send (above), this is what it should look
like:

<iq id='A6' to='baloney at localhost/Gabber' from='jud.localhost'
    type='error'>
  <query xmlns='jabber:iq:register'>
    (your query stuff here)
  </query>
  <error code='NNN'>XXXXXX</error>
</iq>

where NNN is a numeric code and XXXXXXX is the error text. See the JPG
for a list of standard codes (or the server source, in jabberd/lib/lib.h
off the top of my head).

dj



More information about the JDev mailing list