Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
bilalkhan #1
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
Subject: how can i extract information from below iq
  1. <dialogueHistory xmlns="urn:xmpp:dialogueHistory" id="a0a8faaa-512e-44a2-851f-d0e27afb9cf7">
  2.    <MessageID>25858</MessageID>
  3.    <messageText>how are you?</messageText>
  4.    <msgDate>11/23/2016 1:25:49 PM</msgDate>
  5.    <unReadCount>0</unReadCount>
  6. </dialogueHistory>

  1. private void OnIq(object sender, agsXMPP.protocol.client.IQ iq)
  2. {
  3. }

how can i write the xml to get the information from the above stanza?
This post was edited 2 times, last on 2016-11-25, 11:45 by Alex.
Avatar
bilalkhan #2
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
i have receive the above stanza from the server i have to populate my own class chatdialogue from the above information.?

i have tried below code but how can i handle mulitple dialogues in a single query? every time i called firstchild
                  
  1. chatDialogue.DialogueLastMessageId = Convert.ToInt32(iq.Query.FirstChild.GetTag("MessageID"));
  2. chatDialogue.DialogueLastMessage = iq.Query.FirstChild.GetTag("messageText");
  3. chatDialogue.DialogueLastMessageDate = Convert.ToDateTime(iq.Query.FirstChild.GetTag("msgDate"));

how can i get the information of n child gettag information?
This post was edited 3 times, last on 2016-11-25, 11:46 by Alex.
Avatar
Alex #3
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I have shown you here in the this thread on how to build your custom packets:
http://forum.ag-software.net/thread/1963-request-to-server…

Its works the same with the Xml you posted here. Also feel free to study the agsXMPP source code. There are many protocol classes build in which do the same.

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:
Forum: agsXMPP RSS