[PyXMPP] Registering new users

cyberco cyberco at media2b.net
Fri Feb 2 16:37:37 CET 2007


I want to register new users on a xmpp server using pyxmpp, but is that
supported? Using the server from pyxmpp's exampe directory as follows:

=======================
stream = Stream('jabber:client')
stream.connect('localhost', 5222)
iq = Iq(stanza_type='get')
q = iq.new_query("jabber:iq:register")
stream.send(iq)
try:
  stream.loop(1)
finally:
  stream.disconnect()
=======================

throws an exception:

=======================
State: resolving: 'localhost'
State: connecting: ('127.0.0.1', 5222)
State: connected: ('127.0.0.1', 5222)
OUT: '<?xml version="1.0" encoding="UTF-8"?>\n<stream:stream xmlns:stream="
http://etherx.jabber.org/streams" xmlns="jabber:client" to="localhost"
version="1.0">'
OUT: '<iq type="get" id="209840"><query xmlns="jabber:iq:register"/></iq>'
IN: '<?xml version="1.0" encoding="UTF-8"?>\n<stream:stream xmlns:stream="
http://etherx.jabber.org/streams" xmlns="jabber:client" from="localhost"
version="1.0" id="3536-1170430334-429495499852">'
input document: '<?xml version="1.0" encoding="UTF-8"?>\n<stream:stream
xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"
from="localhost" version="1.0" id="3536-1170430334-429495499852"/>\n'
IN: '<stream:features><mechanisms
xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism></mechanisms></stream:features>'
Got stream features
Node: <xmlNode (features) object at 0x1304580>
StartTLS not negotiated
SASL support found
State: fully connected: <JID: u'localhost'>
IN: '<iq  type="error" id="209840" from="localhost"><query
xmlns="jabber:iq:register"/><error type="cancel"><feature-not-implemented
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>'
Unhandled 'iq' stanza: '<iq type="error" id="209840" from="localhost"><query
xmlns="jabber:iq:register"/><error type="cancel"><feature-not-implemented
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>'

=======================

I am totally new to pyxmpp, so I'm not sure whether this means registering
using pyxmpp is not supported, or that the server doesn't support it.

Is there any documentation besides the epydoc at pyxmpp's home? It would be
nice to see a few more examples of how things are done using pyxmpp.

Cheers,
CyBerco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jajcus.net/pipermail/pyxmpp/attachments/20070202/cd66aea1/attachment.html 


More information about the PyXMPP mailing list