[JDEV] Etherx communications..

Thomas Charron tcharron at ductape.net
Mon Jan 31 13:30:41 CST 2000


  Ryan..

    I was looking at XML::Stream today, and I think it may need a few changes 
in order to technically be XML::Stream, and *not* simply a Jabber client XML 
stream.  What I noticed is this:

     When communicating with Etherx versus a transport, the etherx namespace 
needs to be included.  Not, this isn;t simply the streams namespace, but the 
etherx namespace itself.  Etherx requires that the passed stream be able to 
talk xmlns:etherx as well..  Example:

CURRENT:
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" to="server" 
xmlns="jabber:client">

Etherx requires:
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" to="server" 
from="fromname" xmlns="jabber:client" xmlns:etherx="http://etherx.jabber.org" 
etherx:secret="test">

    I'm trying to debate the best way to be able to pass this stuff, without 
breaking the current implementation.  Perhaps some sort of hash needs to be 
passed for namespace, instead of a streait string, along with a 'parameters' 
attribute, if required, aka:

  my $Con = new XML::Stream;

  $Con->Connect(server => "servername",
                name   => "myname",
                port   => 5269,
                namespace => {default  => "jabber:server",
                              etherx   => "http://etherx.jabber.org",
                             },
                attributes => {etherx => {"secret", "test"}}
                );

    This is very complex, though.  Any ideas on how to simplify this?  I was 
almost thinking of having some sort of XML::Stream::Namespace object, where you 
could 'create' a namespace, and pass a series of created namespaces to Connect.

    Also, there is the issue of the fact that messages would come though as:

<message id="someID" to='jabber:test at perl' type='normal' 
from='jabber:tcha at honda/Jabba' etherx:to='perl' etherx:from='honda'/>

  (Yes, it's a completely empty message)

    Net::Jabber::Message objects could handle this fine, but we 'lose' the 
additional etherx namespace data, which a transport may need.

    At this point, I think it's a matter of how we deal with additional 
namespaces.  Technically, XML::Stream should be able to interface with Etherx 
without using jabber:client or jabber:server at all, but since it's a companion 
to etherx, it's still going to need to deal with the etherx namespace, and not 
just the stream namespace..

    Either that, or we need at the very *least*, some way to preserve these 
additional namespace tags, and allow a Net::Jabber::Transport module access to 
them, for *IT* to figure it out..
    
--- 
Thomas Charron
<< Wanted: One decent sig >>
<< Preferably litle used  >>
<< and stored in garage.  ?>>




More information about the JDev mailing list