Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
sirmansoor #1
Member since Sep 2005 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to browse the service offered by the server
I send a browseIq get message to server
It send me a response of its services with tagname = "service" but no class is attached with this tagname.
So wht to do when the callback is called with iq.result  ?

Also tell me the way of using service discovery method if possible
Mansoor Sarfraz
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
hi,

could you please post your debug xml? BrowseIq shouldnt return service tags. It should return a Browse object (browse.cs).
But keep in mind that the JEP-0011 jabber browsing is depricated and service discovery should be used instead of browse.

http://www.jabber.org/jeps/jep-0011.html
http://www.jabber.org/jeps/jep-0030.html

Alex
Avatar
sirmansoor #3
Member since Sep 2005 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: browse services
Here is the snippet of debug xml

SEND: <iq xmlns="jabber:client" id="agsXMPP_5" type="get" to="localhost" from="mansoor@localhost/Home"><query xmlns="jabber:iq:browse" /></iq>
RECV: <iq xmlns="jabber:client" id="agsXMPP_5" type="result" to="mansoor@localhost/Home" from="localhost"><service xmlns="jabber:iq:browse" type="jabber" jid="localhost" name="Jabber Server"><service type="jud" jid="users.jabber.org" name="Jabber User Directory"><ns>jabber:iq:search</ns><ns>jabber:iq:register</ns></service></service></iq>
Mansoor Sarfraz
Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
hi sirmansoor,

this is a very old historic browse protocol version what your server is using here. Because of this reason its not implemeted in agsXMPP. I think i will implement the service class because jabberd 1.x and wpjabber servers are still using this old protocols. I will post a message here when the updated code is in svn.

Alex
Avatar
Alex #5
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
i added support for the old service protocol. The code is in SVN.
here is a small sample how to use it:

private void button1_Click_1(object sender, System.EventArgs e)
{
    agsXMPP.protocol.iq.browse.BrowseIq iq = new agsXMPP.protocol.iq.browse.BrowseIq(IqType.get, new Jid(&quot;myjabber.net&quot;));           
    this.XmppCon.IqGrabber.SendIq(iq, new IqCB(OnBrowseIQ), null);           
}
       
       
private void OnBrowseIQ(object sender, IQ iq, object data)
{           
    Element s = iq.SelectSingleElement(typeof(agsXMPP.protocol.iq.browse.Service));
    if (s!=null)
    {
        agsXMPP.protocol.iq.browse.Service service = s as agsXMPP.protocol.iq.browse.Service;
        string[] ns = service.GetNamespaces();
    }           
}
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