Not logged in. · Lost password · Register
Forum: MatriX RSS
Oneleg #1
Member since Sep 2012 · 4 posts · Location: Ostersund, SWEDEN
Group memberships: Members
Show profile · Link to this post
Subject: Newbie question about namespace in Iq

I've just started to use Matrix and I have a wondering about the namespace in the Iq stanca. Is it always "jabber:client" ?

If i look at the XML generated by my custom iq it looks like this:

  1. <iq id="MX_2" type="set" xmlns="jabber:client">
  2.  <SendMessage xmlns="Mercury.MercuryClient">
  3.     <Users>
  4.       <User>
  5.         <UserName>MyUser1</UserName>
  6.       </User>
  7.       <User>
  8.         <UserName>MyUser2</UserName>
  9.       </User>
  10.     </Users>
  11.     <Priority>1</Priority>
  12.     <Subject>Test</Subject>
  13.     <Body>This is a test</Body>
  14.     <ExpirationDate>2012-01-02 00:00:00</ExpirationDate>
  15.  </SendMessage>
  16. </iq>

As you can see I've set the namespace on the payload for the Iq (SendMessage) by calling the baseconstructor when creating my
SendMessageIq, but the namespace for the actual iq doesn't appear to be settable.

  1.         /// <summary> Constructor, set namespace and XML tag. </summary>
  2.         public SendMessagePayload()
  3.             : base(Settings.Default.AssemblyNamespace, "SendMessage")
  4.         {
  5.         }

My question is simply this: Should I be able to set the namespace for the iq or should it always be "jabber:client"?

This post was edited on 2012-10-11, 11:11 by Alex.
Edit reason: code formatting
Alex #2
Member since Feb 2003 · 4346 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi Robert,

the namespaces of the stanzas (top level elements) iq, message and presence MUST be always jabber:client for a client connection. You cannot change them. The children (payload) can be in any namespace you want. So you are doing everything correct in your code.
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