Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
preraksanghvi #1
Member since Nov 2008 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: BoshClientSocket bad xmlns definition
I was playing around with MiniClient application by changing it to use BOSH to connect to Openfire.  During that process, I discovered two issues in BoshClientSocket.cs related to invalid XML (they are fairly blatant issues that prevent Bosh from working at all):

1. In RequestBoshSession method, the following line is incorrect:

body.SetAttribute("xmpp:xmlns", "urn:xmpp:xbosh")

This should instead use xmlns:xmpp for defining the namespace as:

body.SetAttribute("xmlns:xmpp", "urn:xmpp:xbosh")

Because of this bug, the xml is incorrect and Openfire won't even initiate the connection over BOSH.

2.  In BuildPostData method, when body.XmppRestart is set to true, no namespace definition is added for xmpp.  So the xmpp:restart attribute is added without declaring the xmpp namespace.  The above line for xmlns:xmpp attribute should be added where body.XmppRestart is set to true.

In general though, I would have liked to see this built into the property setters for Body class.  If you set any Xmpp* properties (XmppVersion and XmppRestart current), the class should itself add the namespace declaration in the setter code.

Other than this, I'm loving agsXMPP - it is a fantastic library that can be put to many good uses.

Thanks,
Prerak Sanghvi
Avatar
Alex #2
Member since Feb 2003 · 4311 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
thanks for posting this issue.
The bug is fixed. I tested the code with Openfire and committed the new code to SVN.

Alex
Avatar
zys #3
Member since Apr 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Although this seems to be an old bug!
But I just downloaded AGS from the SVN and I found that in BoshClientSocket.cs
the code
body.SetAttribute("xmpp:xmlns", "urn:xmpp:xbosh");
still exists.

Even when fixing this, the AGS is unable to connect to Openfire using BOSH.
The errors are still related to the message XML format: "unkown xmpp namespace" !!!!

Regards
Avatar
Alex #4
Member since Feb 2003 · 4311 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The namespace was fixed in SVN, but Openfires BOSH implementation has a bug. It sends all stanzas in the BOSH namespace and not the jabber:client namespace.
I contacted the developer and hopefully his will be fixed in the next version.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS