Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Lightbarrier #1
Member since Jul 2014 · 52 posts
Group memberships: Members
Show profile · Link to this post
Subject: Problem With Extending Matrix
First thanks for your help.

I realize this question has been asked before, but I've made multiple attempts, and have gotten the same results no matter what I do.

I'm trying to pass one set of data using (XmppXElement and Iq) to another client however, even when I run the Weather example solution I get the same problem which is the error like this on a OpenFire Server:

  1. <iq type="error" id="MX_6" from="guest1@domain" to="guest@domain/MatriX" xmlns="jabber:client">
  2.  <weather xmlns="ag-software:weather">
  3.     <zip>58722</zip>
  4.  </weather>
  5.  <error code="503" type="cancel">
  6.     <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  7.  </error>

After reading some topics on the forum it seems that this is suppose to mean that the other user isn't online however, I've verified that he's running even checking the server admin console itself. I'm a little lost in regards to what the problem is, any advice would be a great help.
This post was edited on 2014-07-23, 10:44 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Can you please post your complete xml log of the whole session?

Thanks
Avatar
Lightbarrier #3
Member since Jul 2014 · 52 posts
Group memberships: Members
Show profile · Link to this post
Subject: Thanks for your help
From your Weather Example both clients are running and user1 makes the get request for user2:

  1. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="4qxykq1" version="1.0" >
  2. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="4qxykq1" id="6afe121" xml:lang="en" version="1.0" >
  3. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  4.  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  5.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  6.     <mechanism>DIGEST-MD5</mechanism>
  7.     <mechanism>PLAIN</mechanism>
  8.     <mechanism>ANONYMOUS</mechanism>
  9.     <mechanism>CRAM-MD5</mechanism>
  10.  </mechanisms>
  11.  <compression xmlns="http://jabber.org/features/compress">
  12.     <method>zlib</method>
  13.  </compression>
  14.  <auth xmlns="http://jabber.org/features/iq-auth" />
  15.  <register xmlns="http://jabber.org/features/iq-register" />
  16. </stream:features>
  17. SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  18. RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  19. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="4qxykq1" version="1.0" >
  20. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="4qxykq1" id="6afe121" xml:lang="en" version="1.0" >
  21. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  22.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  23.     <mechanism>DIGEST-MD5</mechanism>
  24.     <mechanism>PLAIN</mechanism>
  25.     <mechanism>ANONYMOUS</mechanism>
  26.     <mechanism>CRAM-MD5</mechanism>
  27.  </mechanisms>
  28.  <compression xmlns="http://jabber.org/features/compress">
  29.     <method>zlib</method>
  30.  </compression>
  31.  <auth xmlns="http://jabber.org/features/iq-auth" />
  32.  <register xmlns="http://jabber.org/features/iq-register" />
  33. </stream:features>
  34. SEND: <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
  35. RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09IjRxeHlrcTEiLG5vbmNlPSJyNGpYT0k4OTVBODBVeGFuZXRBQVhKTG1YdnR0L2plRVZuUVF3MHJUIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
  36. SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9InVzZXIxIixyZWFsbT0iNHF4eWtxMSIsbm9uY2U9InI0alhPSTg5NUE4MFV4YW5ldEFBWEpMbVh2dHQvamVFVm5RUXcwclQiLGNub25jZT0iNWVlNTY2M2FkYmEzNzNkNTA0NmI0NDY1Y2FiMzk0NWE1ZmJiYjk5MDQ3ZDIwZjNkZWY1OThmN2JjMzM0Yjc4MiIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC80cXh5a3ExIixjaGFyc2V0PXV0Zi04LHJlc3BvbnNlPTM5ZWFjMjUwMTdiZWE3NGJlOTUxNjJiZDMyZjBkMTU5</response>
  37. RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD0xOWI5OGJhN2M1MTc0OWY0YWZiNzgxM2Y2N2I2OTAyOQ==</success>
  38. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="4qxykq1" version="1.0" >
  39. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="4qxykq1" id="6afe121" xml:lang="en" version="1.0" >
  40. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  41.  <compression xmlns="http://jabber.org/features/compress">
  42.     <method>zlib</method>
  43.  </compression>
  44.  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
  45.  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
  46. </stream:features>
  47. SEND: <iq id="MX_1" type="set" xmlns="jabber:client">
  48.  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
  49.     <resource>MatriX</resource>
  50.  </bind>
  51. </iq>
  52. RECV: <iq type="result" id="MX_1" to="4qxykq1/6afe121" xmlns="jabber:client">
  53.  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
  54.     <jid>user1@4qxykq1/MatriX</jid>
  55.  </bind>
  56. </iq>
  57. SEND: <iq id="MX_2" type="set" xmlns="jabber:client">
  58.  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
  59. </iq>
  60. RECV: <iq type="result" id="MX_2" to="user1@4qxykq1/MatriX" xmlns="jabber:client" />
  61. SEND: <iq id="MX_3" type="get" xmlns="jabber:client">
  62.  <query xmlns="jabber:iq:roster" />
  63. </iq>
  64. RECV: <iq type="result" id="MX_3" to="user1@4qxykq1/MatriX" xmlns="jabber:client">
  65.  <query xmlns="jabber:iq:roster">
  66.     <item jid="user2@4qxykq1" name="Janet" subscription="both">
  67.       <group>chatGroup</group>
  68.     </item>
  69.     <item jid="user3@4qxykq1" name="user3" subscription="both">
  70.       <group>chatGroup</group>
  71.     </item>
  72.  </query>
  73. </iq>
  74. SEND: <presence xmlns="jabber:client">
  75.  <show>chat</show>
  76.  <status>I'm chatty</status>
  77.  <priority>0</priority>
  78. </presence>
  79. RECV: <presence from="user1@4qxykq1/MatriX" to="user1@4qxykq1/MatriX" xmlns="jabber:client">
  80.  <show>chat</show>
  81.  <status>I'm chatty</status>
  82.  <priority>0</priority>
  83. </presence>
  84. RECV: <presence from="user2@4qxykq1/MatriX" to="user1@4qxykq1/MatriX" xmlns="jabber:client">
  85.  <show>chat</show>
  86.  <status>I'm chatty</status>
  87.  <priority>0</priority>
  88. </presence>
  89. SEND: <iq id="MX_4" type="get" to="user2@4qxykq1" xmlns="jabber:client">
  90.  <weather xmlns="ag-software:weather">
  91.     <zip>98223</zip>
  92.  </weather>
  93. </iq>
  94. RECV: <iq type="error" id="MX_4" from="user2@4qxykq1" to="user1@4qxykq1/MatriX" xmlns="jabber:client">
  95.  <weather xmlns="ag-software:weather">
  96.     <zip>98223</zip>
  97.  </weather>
  98.  <error code="503" type="cancel">
  99.     <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  100.  </error>
  101. </iq>
This post was edited on 2014-07-23, 20:32 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you are sending the Iq here to a bare Jid instead of a full Jid:

  1. SEND: <iq id="MX_4" type="get" to="user2@4qxykq1" xmlns="jabber:client">
  2.  <weather xmlns="ag-software:weather">
  3.     <zip>98223</zip>
  4.  </weather>
  5. </iq>
  6. RECV: <iq type="error" id="MX_4" from="user2@4qxykq1" to="user1@4qxykq1/MatriX" xmlns="jabber:client">
  7.  <weather xmlns="ag-software:weather">
  8.     <zip>98223</zip>
  9.  </weather>
  10.  <error code="503" type="cancel">
  11.     <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  12.  </error>
  13. </iq>

you send the packet to:
user2@4qxykq1

instead of:
user2@4qxykq1/MatriX

Iqs in XMPP must go always to full Jids. There are only some exception like vcards for example that to the server which has no resource.
Try to change this and it should work.

Alex
Avatar
Lightbarrier #5
Member since Jul 2014 · 52 posts
Group memberships: Members
Show profile · Link to this post
Strange, I swear just yesterday I tried the full Jid with "/Matrix" and I had the same results but I tried it again now and all of a sudden it magically works. Thanks for your help.

Edit:
When thinking about it more I'm surprised we don't receive the full jid upon all events which involve another user, this kind of relies that we put together the full Jid ourselves.
This post was edited on 2014-07-23, 21:43 by Lightbarrier.
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you see this error response when:

  • the user is offline
  • you send to a bare jid only
  • you send to a non existing user or resource
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: MatriX RSS