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:
This should instead use xmlns:xmpp for defining the namespace as:
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
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
preraksanghvi
Show profile
Link to this post
