Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Cojito123 #1
Member since Jul 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to get parts outside of IQ
Hello there,
As far as my understating is concerned, i know that i can retrieve parts inside of the <iq> tags really easy but the fun part i could not find anything about is outside of those tags.

My requirement for my program is to get the Userdata out of here and in my DB but i cant seem to retrieve it :(

Here is my XML


<body xmlns='http://jabber.org/protocol/httpbind'>
<presence xmlns='jabber:client' from='jid' to='jid'>
<nick xmlns='http://jabber.org/protocol/nick'>Diana</nick>
<user_data xmlns='http://domain/protocol/user#data'>name:Diana;gender:;age:;single:;url/user/4;pic:picture-4.jpg;city:;zip:;country:</user_data>
</presence>
<iq xmlns='jabber:client' from='Jid' to='JiD' id='JSJaCID_1' type='result'>
<query xmlns='http://domain/protocol/users'><limit>0</limit>
<offset>0</offset><online>1</online></query>
</iq>
</body>

I hope i could my myself clear somehow =)

best wishes
Joe
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
what you are looking for is described in the custom packet tutorial which is included in the SDK.
Please study this tutorial and come back if you still have problems or questions.

Alex
Avatar
Cojito123 #3
Member since Jul 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
i dont even know how to start :(

i tried setting up the IQ handler with:
  xmppCon.OnIq += new IqHandler(xmpp_OnIq);

pointing to
        private void xmpp_OnIq(object sender, IQ iq)
        {

}

which is then telling me that iam missing an object reference. Plus the custom type packet tutorial is speakig about
grabbing some content in a message but this isnt a message :/

Maybe im just not seeing through this right.. :/

Nevermind i had the wrong packet... i need to change it when the presence updates occur
This post was edited on 2009-07-15, 11:44 by Cojito123.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Cojito123:
i tried setting up the IQ handler with:
  xmppCon.OnIq += new IqHandler(xmpp_OnIq);

pointing to
        private void xmpp_OnIq(object sender, IQ iq)
        {

}
the correct signature is:
  1. void VcardResult(object sender, IQ iq, object data)

Quote by Cojito123:
which is then telling me that iam missing an object reference. Plus the custom type packet tutorial is speakig about
grabbing some content in a message but this isnt a message :/

Maybe im just not seeing through this right.. :/

Nevermind i had the wrong packet... i need to change it when the presence updates occur

Message or Iq is only the container. So the code is nearly the same, it does not matter what you use. When using iq you only have to send your packets to a full Jid. This is important.

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