[PyXMPP] Custom protocol: message- or IQ-based?

cyberco cyberco at media2b.net
Sun Feb 18 20:55:02 CET 2007


I'd like to implement a client-to-client messaging protocol on top of
PyXMPP, but I wonder if I should use standard messages, or IQ packets. The
content of my protocol will be YAML. I tried using IQ packets, but didn't
get it working. I was able to send out valid IQ packets, but always got an
error back.


iq = Iq(from_jid=fromJid, to_jid=toJid, stanza_type='get')
queryNode = iq.new_query(ns_uri='http://www.company.com/app')
yamlNode = libxml2.newNode('yaml')
self.stream.set_response_handlers(iq,self.onIqResult, self.onIqError,


This results in the following IQ packet:

<iq from="x at x.com/home" to="y at y.com" type="get" id="979308"><query xmlns="

and the following error:

<query xmlns="http://www.company.com/app"><yaml/></query>

I wonder if the namespace is the problem. Can I just use any namespace as
long as both clients know it?

A disadvantage seems to be that IQ packets are not stored if the other is
offline. Any other disadvantages?

Thanks for any advice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jajcus.net/pipermail/pyxmpp/attachments/20070218/19ef2855/attachment.html 

More information about the PyXMPP mailing list