Not logged in. · Lost password · Registration disabled
Forum: MatriX and XmppDotNet RSS
Avatar
xiaotluckly #1
Subject: OnIq handler not raise
hello?I have implemented the OnReceiveXml  and OnIq handler ?but that is strange?when i am send a iq?the OnReceiveXml handler can receive the iq  but the onIq  can't?can you help me?thanks?
Avatar
Alex #2
This behavior is correct. OnIq fires only on incoming Iqs.

Alex
Avatar
xiaotluckly #3
oh sorry,i means that the incoming Iqs the OnReceiveXml handler can receive but the onIq  can't?do you kown why? thank you~
Avatar
Alex #4
No. I'm saying that the OnIq handler must fire on incoming Iqs.
Please post your complete debug XML if it doesn't.

Alex
Avatar
xiaotluckly #5
 the code:

 xmppClient.OnReceiveXml += new EventHandler<TextEventArgs>(XmppClientOnReceiveXml);
 xmppClient.OnIq += new EventHandler<IqEventArgs>(xmppClient_OnIq);

 private void XmppClientOnReceiveXml(object sender, TextEventArgs e)
        {
            Debug.WriteLine("REC: " + e.Text);

        }


private void xmppClient_OnIq(object sender, IqEventArgs e)
        {
                     
            Debug.WriteLine("OnIq"+e.Iq.ToString());
        }

the debug xml:

SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="megafon.ru" version="1.0" >
REC: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client:simplified" from="megafon.ru" id="f2f87abb-c276-427b-847c-22365b907bfb" version="1.0" xml:lang="en" >
REC: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>PLAIN</mechanism>
    <mechanism>ANONYMOUS</mechanism>
  </mechanisms>
  <register xmlns="http://jabber.org/features/iq-register" />
  <auth xmlns="http://jabber.org/features/iq-auth" />
</stream:features>
SEND: <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
REC: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
OnLogin
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="megafon.ru" version="1.0" >
REC: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client:simplified" from="megafon.ru" id="f2f87abb-c276-427b-847c-22365b907bfb" version="1.0" lang="en" >
REC: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
  <register xmlns="http://jabber.org/features/iq-register" />
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
</stream:features>
SEND: <iq id="MX_1" type="set" xmlns="jabber:client">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <resource>Matrix Windows Phone</resource>
  </bind>
</iq>
REC: <iq type="result" id="MX_1" to="+79271212123@megafon.ru/Matrix Windows Phone" xmlns="jabber:client:simplified">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <jid>+79271212123@megafon.ru/Matrix Windows Phone</jid>
  </bind>
</iq>

he onIq  handler can't receive the iq,can you help me ,thks~
This post was edited on 2012-12-14, 12:25 by Alex.
Avatar
Alex #6
Quote by xiaotluckly:
<iq type="result" id="MX_1" to="+79271212123@megafon.ru/Matrix Windows Phone" xmlns="jabber:client:simplified">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <jid>+79271212123@megafon.ru/Matrix Windows Phone</jid>
  </bind>
</iq>

your server returns the iq in a wrong namespace.
jabber:client:simplified instead of jabber:client, the same applies also to previous packets. They advertise also a wrong namespace.

This cannot work and violates the XMPP specs. Please fix your server.
Which server software are you using?

Alex
This post was edited on 2012-04-23, 10:06 by Alex.
Avatar
xiaotluckly #7
 the server is provide by other company,we can not fix them, Is there any other way to solve this problem? can you Let  the matrix support this namespace : xmlns="jabber:client:simplified",thank you~
Avatar
Alex #8
Quote by xiaotluckly:
Is there any other way to solve this problem? can you Let  the matrix support this namespace : xmlns="jabber:client:simplified",thank

This server violates the XMPP protocol. Every client, library or other server which is namespace aware will have problems to talk to this server. A dirty hack in the MatriX sources would be possible, but not in any public release.

Alex
Avatar
xiaotluckly #9
Quote by Alex:
A dirty hack in the MatriX sources would be possible, but not in any public release.
Alex

can you give me one? i need it~
Avatar
Alex #10
Quote by xiaotluckly:
can you give me one? i need it~

please contact me directly by email.

Alex