[jdev] Perl registration with Net::Jabber and RegisterSend
Hans Poo
hans at opensource.cl
Wed Nov 24 10:56:45 CST 2004
Sorry
I've just responded myself, the hostname is wrong, it must be equal to one of
the registered host names in jabber.xml:
In this case is $c->Connect(hostname=>"portalciudadano.cl") instead of
$c->Connect(hostname=>"localhost").
It corresponds to the clause "to" in the connection stream, ie: <stream:stream
to='portalciudadano.cl'.
Note: Sometimes you find the answer when you tell your problem to another person.
Thanks for listening
Hans
On Tue, 23 Nov 2004 13:44:13 -0400, Hans Poo wrote
> Hi
>
> I have a Perl user registration application and i need to create the
> coresponding jabber user accounts. I'am using mod_perl and
> Net::Jabber. This is my test script.
>
> my $c = new Net::Jabber::Client();
> $c->Connect(hostname=>"localhost");
> if ($c->Connected()) {
> print "We are connected to the server...\n";
> }
>
> @result = $c->RegisterSend(
> username => "winnie",
> password => "secret",
> email => "winnie\@fun.com",
> name => "Winnie the Poh");
>
> print join "\n", @result;
>
> The connection succeed but the account is not created.
> The server register correctly when
> using raw xml, this is the test:
>
> [root at marte root]# telnet localhost 5222
> Trying 127.0.0.1...
> Connected to localhost.localdomain (127.0.0.1).
> Escape character is '^]'.
> <stream:stream to='portalciudadano.cl' xmlns='jabber:client'
> xmlns:stream='http://etherx.jabber.org/streams'>
> <?xml version='1.0'?><stream:stream
> xmlns:stream='http://etherx.jabber.org/streams' id='41A37DCA'
> xmlns='jabber:client' from='portalciudadano.cl'>
> <iq id='abcde' type='set'>
> <query xmlns='jabber:iq:register'>
> <username>Winnie</username>
> <password>secret</password>
> <name>Winnie the Poh</name>
> <email>winie at fun.com</email>
> </query>
> </iq>
> <iq id='abcde' type='result'/>
>
> This telnet session create the apropriate xml account file in the
> corresponding spool directory.
>
> I've been searching a lot about it. I 'am not sure if what i'am
> doing is correct.
>
> Hans
>
> ------------------------------------------------------------------------
> El problema de fondo es diseñar soluciones elegantes e inteligentes,
> las herramientas sólo son las herramientas.
>
> Hans Poo, http://hans.opensource.cl, hans at opensource.cl, F: 09-319.93.05
> Consultor Linux, Desarrollo Web OpenSource.
> Santiago, Chile
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mail.jabber.org/mailman/listinfo/jdev
------------------------------------------------------------------------
El problema de fondo es diseñar soluciones elegantes e inteligentes, las
herramientas sólo son las herramientas.
Hans Poo, http://hans.opensource.cl, hans at opensource.cl, F: 09-319.93.05
Consultor Linux, Desarrollo Web OpenSource.
Santiago, Chile
More information about the JDev
mailing list