Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
poma #1
Member since Feb 2012 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Invalid-namespace error
Hi all

    I'm currently migrating from agxXMPP to MatriX, and have following problem. After sending iq:

  1. <iq type="get" id="MX_1" xmlns="jabber:client">
  2.  <query xmlns="mynamespace:init" />
  3. </iq>

 I receive error InvalidNamespace

  1. <stream:error xmlns:stream="http://etherx.jabber.org/streams">
  2.  <invalid-namespace xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
  3. </stream:error>

Should I somehow register my namespace in order to send IQ? Something like Factory.Register method?
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Can you post the complete XML of your stream? In the XML you posted I see no errors.
The factory doesn't matter for outgoing packets, it's required for serialization of incoming packets only.

Alex
Avatar
poma #3
Member since Feb 2012 · 8 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex

   Full log:

  1. [out]
  2. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="node3.myserver.com" version="1.0" >
  3.  
  4. [in]
  5. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="942266069" from="node3.myserver.com" version="1.0" xml:lang="en" >
  6.  
  7. [in]
  8. <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  9.  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  10.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  11.     <mechanism>SCRAM-SHA-1</mechanism>
  12.     <mechanism>ANONYMOUS</mechanism>
  13.     <mechanism>DIGEST-MD5</mechanism>
  14.     <mechanism>PLAIN</mechanism>
  15.  </mechanisms>
  16.  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="TQ2JFyRoSa70h2G1bpgjzuXb2sU=" />
  17.  <register xmlns="http://jabber.org/features/iq-register" />
  18. </stream:features>
  19.  
  20. [out]
  21. <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  22.  
  23. [in]
  24. <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  25.  
  26. [out]
  27. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="node3.myserver.com" version="1.0" >
  28.  
  29. [in]
  30. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="3207786398" from="node3.myserver.com" version="1.0" lang="en" >
  31.  
  32. [in]
  33. <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  34.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  35.     <mechanism>SCRAM-SHA-1</mechanism>
  36.     <mechanism>ANONYMOUS</mechanism>
  37.     <mechanism>DIGEST-MD5</mechanism>
  38.     <mechanism>PLAIN</mechanism>
  39.  </mechanisms>
  40.  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="TQ2JFyRoSa70h2G1bpgjzuXb2sU=" />
  41.  <register xmlns="http://jabber.org/features/iq-register" />
  42. </stream:features>
  43.  
  44. [out]
  45. <auth mechanism="SCRAM-SHA-1" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">bjwsbj10ZXN0bm9kZTN0c2RzLHI9YThBUTlqUUIxa05ZMDJtZ210TFR3Tm9BRC9CTFBiTzU=</auth>
  46.  
  47. [in]
  48. <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cj1hOEFROWpRQiFrTlkwMm1nbXRMVHdOb0FEL0JMUGJPNTJZd1h2SWJldllCUTc2UWdyWTg4ckE9PSxzPUMzMFM5OHNERGxvVUNpNW1IMEw5QXc9PSxpPTQwOTY=</challenge>
  49.  
  50. [out]
  51. <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Yz1jaXdzLHI9YThBUTlqUUIxa05ZMDJtZ210TFR3Tm9BRC9CTFBiTzUyWXdYdkliZXZZQlE3NlFnclk4OHJBPT0scD0yN2REVHJ4SkgrU2tQVE5ZYllIL0tBc2FWUGc9</response>
  52.  
  53. [in]
  54. <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">di1nVnFNdDR3MWRpaTdhc1FhVWxKdDlRT1hoelk9</success>
  55.  
  56. [out]
  57. <presence xmlns="jabber:client">
  58.  <show>chat</show>
  59.  <status></status>
  60.  <priority>0</priority>
  61. </presence>
  62.  
  63. [out]
  64. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="node3.myserver.com" version="1.0" >
  65.  
  66. [out]
  67. <iq type="get" id="MX_1" xmlns="jabber:client">
  68.  <query xmlns="mynamespace:init" />
  69. </iq>
  70.  
  71. [in]
  72. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="4032853823" from="localhost" lang="en" >
  73.  
  74. [in]
  75. <stream:error xmlns:stream="http://etherx.jabber.org/streams">
  76.  <invalid-namespace xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
  77. </stream:error>


Any ideas why I receive InvalidNamespace error?
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by poma:
Any ideas why I receive InvalidNamespace error?

no, the error the server is sending is not correct. But what I see is:

1) in line 56 you send out a presence packet way to early.
2) in line 72 from switches from node3.myserver.com to localhost.

Sending the presence that early is not correct. I guess this confuses the server.

Alex
Avatar
poma #5
Member since Feb 2012 · 8 posts
Group memberships: Members
Show profile · Link to this post
Yeah, thanks, I already figured out, that I have to wait on Bind event, not just LoggedIn.

But now I have new problem. Incoming messages are not deserialized into my custom types.
To be more precise, that is my custom message:

  1. public class Message : Matrix.Xmpp.Client.Message {}

In the begning I register my custom class:

  1. Factory.RegisterElement<Message>("message");

But in OnMessage event I receive Matrix.Xmpp.Client.Message object, instead of my type.

Any ideas? :)
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by poma:
Any ideas? :)

yes,

  1. Factory.RegisterElement<Message>(Uri.CLIENT, "message");
Avatar
poma #7
Member since Feb 2012 · 8 posts
Group memberships: Members
Show profile · Link to this post
Thanks a lot, it works :-)
Avatar
poma #8
Member since Feb 2012 · 8 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #6
Actually, I have one more problem
If you'd be so kind to help me :-)
I noticed that sending presence (through xmppClient.SendPresence()) right after OnBind event is not sufficient, it somehow lacks attributes From and To:

  1. <presence xmlns="jabber:client">  <show>chat</show>  <status></status>  <priority>0</priority></presence>

 But in the xmpp logs I can see following packet:

  1.  <iq xmlns="jabber:client" id="someid" type="result" from="node3.myserver.com"><session xmlns="urn:ietf:params:xml:ns:xmpp-session" /></iq>

Looks like session initialization. And after it sending presence works correctly. Are there any way to listen to the event of the session initialization?
This post was edited on 2012-07-24, 14:42 by poma.
Avatar
Alex #9
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  • from and to attributes are not required for outgoing presences, the server stamps them.
  • you don't have to send a presence manual at all. MatriX does this automatically when the session is ready.
  • your session is ready when you get the first incoming presence (OnPresence). You can also use the OnBind or OnRosterEnd event.
  • the session stuff was removed with the RFCs. Your server software is not very up to date when it still offers the session feature.
This post was edited on 2012-07-24, 14:42 by 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: