×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up How to develop XMPP client for symbian

    Hi All,
    I want to develop an IM client,as i seen i can do it using XMPP and its library..so can i know can i develop client for symbian and which server i need to use..(openfire ..etc..).so let me if there any link or docs to go through to start developing.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to develop XMPP client for symbian

    OpenFire is a peaceful choice, it is possible to use it both with and without encryption (Ejabberd does not work with encryption).
    Then visit www.xmpp.org, and check documentation/rfc-s, and as a first try sending fixed messages to the server.

  3. #3
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    ya i seen xmpp.org site ,i seen RFc's and libraries.so i planning to use C++ libraries gloox to develop symbian client and how i need to connect to sever(open fire) .so i need some help how to start using those libraries in symbian..

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to develop XMPP client for symbian

    I can not help in that, since I have developed my own library.
    But libraries usually come with documentation, and perhaps examples too, so you should check them if they exist.

  5. #5
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    hi.atleast can i know how to connect to openfire sever from symbian client...what Apis i need to use.i have one doudt once i develop xmpp client for symbian i need to hit openfire server or direct gtalk server for IM and presence..can u send some docs or link how to start developing client for symbian..

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to develop XMPP client for symbian

    I really can not see the problems with an initial attempt:
    Code:
    RSocketServ serv;
    serv.Connect();
    RSocket sock;
    sock.Open(serv,KAfInet, KSockStream, KProtocolInetTcp);
    TInetAddr addr(KInetAddrLoop,5222);
    TRequestStatus stat;
    sock.Connect(addr,stat);
    User::WaitForRequest(stat);
    console->Printf(_L("Connect status: %d\n"),stat.Int());
    and you are connected.
    Then according to 4.8 (http://xmpp.org/rfcs/rfc3920.html#streams)
    Code:
    _LIT8(KStart8,"<?xml version='1.0'?>\
       <stream:stream\
           to='servername'\
           xmlns='jabber:client'\
           xmlns:stream='http://etherx.jabber.org/streams'\
           version='1.0'>");
    sock.Write(KStart8(),stat);
    User::WaitForRequest(stat);
    console->Printf(_L("Write status: %d\n"),stat.Int());
    TBuf8<100> buf8;
    sock.Read(buf);
    User::WaitForRequest(stat);
    console->Printf(_L("Read status: %d\n"),stat.Int());
    TBuf<100> buf;
    buf.Copy(buf8);
    console->Printf(buf);
    and you have started the client stream and received the first 100 bytes of the response.
    servername should match the name set for your OpenFire server
    It is a console-based fragment where error handling is completely removed - though status codes are reported.

  7. #7
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    hi,i Tired by the code u given me...first i connected by

    RSocketServ serv;
    serv.Connect();
    RSocket sock;
    sock.Open(serv,KAfInet, KSockStream, KProtocolInetTcp);
    TInetAddr address ;
    address.SetAddress(INET_ADDR(127,0,0,1));
    address.SetPort (5222);
    TRequestStatus stat;
    sock.Connect(address,stat);
    User::WaitForRequest(stat);

    TBuf<20> status;
    status.Format(_L("%d"),stat.Int());

    given me stat.Int() is zero.

    then i added other code to send request to server like this

    RSocketServ serv;
    serv.Connect();
    RSocket sock;
    sock.Open(serv,KAfInet, KSockStream, KProtocolInetTcp);
    TInetAddr address ;
    address.SetAddress(INET_ADDR(127,0,0,1));
    address.SetPort (5222);
    TRequestStatus stat;
    sock.Connect(address,stat);
    User::WaitForRequest(stat);

    TBuf<20> status;
    status.Format(_L("%d"),stat.Int());
    //CEikonEnv::Static()->AlertWin(status);
    //console->Printf(_L("Connect status: %d\n"),stat.Int());
    //SetActive();
    _LIT8(KStart8,"<stream:stream
    xmlns='jabber:client'
    xmlns:stream='http://etherx.jabber.org/streams'
    to='sumanth'
    version='1.0'>");
    sock.Write(KStart8(),stat);
    User::WaitForRequest(stat);
    //console->Printf(_L("Write status: %d\n"),stat.Int());
    TBuf8<100> buf8;

    sock.Read(buf8,stat);
    User::WaitForRequest(stat);
    //console->Printf(_L("Read status: %d\n"),stat.Int());
    TBuf<100> buf;
    buf.Copy(buf8);
    CEikonEnv::Static()->AlertWin(buf);

    My Server name is sumanth.
    I installed openfire server on my pc with server name "sumanth" and when tried http://127.0.0.1:5222 it showing nothing in browser..but from emulator first block of code giving me ZERO then for read write operation status it not showing anything..

    so whats next step i need to do...to get reply from server..iam using openfire server.


    Atlast screen getting dim..

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to develop XMPP client for symbian

    Oh, I missed the XML header, sorry.
    Try
    Code:
    _LIT8(KStart8,"<?xml version='1.0' encoding='utf-8'?>\
    <stream:stream xmlns='jabber:client'\
    xmlns:stream='http://etherx.jabber.org/streams'\
    to='sumanth' version='1.0'>");

  9. #9
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    Hi wizard..i got response in back..by adding new lines u sent.
    now we done with our first step...now what is next ..need to do..if possible can u tell me next 2 steps to implement...then..we keep on proceeding...thank u for u r help..

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to develop XMPP client for symbian

    Check the further examples on the XMPP site. With proper configuration of OpenFire it should be possible to work without encryption (so you can skip starttls), thus you can simply authenticate yourself (suggested method: PLAIN, Base64 encoding is documented in the Wiki), since the string contains null-characters as separator, it is safer to construct it incrementally:
    Code:
    TBuf8<100> buf;
    buf.Append(_L("test@sumanth"));
    buf.Append(0);
    buf.Append(_L("test"));
    buf.Append(0);
    buf.Append(_L("password"));
    Base64 encode, wrap it into an auth element with mechanism='PLAIN', and check what happens.
    If everything is fine, read the examples further, bind a resource, and start a session.
    If things are still working, you can set your presence, and check it from the admin page of OpenFire.
    Since the responses are not handled by now, and their size varies a lot, you may consider increasing buffer size to 1000, and using RecvOneOrMore instead of Read. This way you will probably see more.

  11. #11
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    where i can find examples in xmpp to connect server with username and password.I need to check libraries..?? or which Api's i need to use for it..

  12. #12
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    hi wizard,here is the follow i got reposne from server.....


    C:

    <?xml version='1.0' encoding='utf-8'?>\
    <stream:stream xmlns='jabber:client'\
    xmlns:stream='http://etherx.jabber.org/streams'\
    to='sumanth' version='1.0'>

    S:

    <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="sumanth" id="4774c6cb" xml:lang="en" version="1.0">tfarams:xml:ns:xmpp-tls"></starttls><mechanisms xmlns="urn:ietfarams:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>

    C:

    <?xml version='1.0' encoding='utf-8'?>\
    <iq type='get' to='sumanth' id='auth1'> "
    " <query xmlns='jabber:iq:auth'/></iq>

    S:

    <iq type="result" id="auth1" from="sumanth"><query xmlns="jabber:iq:auth"><username/><password/><digest/><resource/></query></iq>

    C:

    <?xml version='1.0' encoding='utf-8'?>\
    <iq type='set' id='auth2'>"
    "<query xmlns='jabber:iq:auth'>"
    "<username>mskumar</username>"
    "<password>mskumar</password>"
    "<resource>globe</resource>"
    "</query>"
    "</iq>"

    S:

    Server Resonded with error for wrong password :

    <iq type="error" id="auth2" to="sumanth/4774c6cb"><query xmlns="jabber:iq:auth"><username>mskumar</username><password>mskumar1</password><resource>globe</resource></query><error code="401" type="auth"><not-authorized xmlns="urn:ietfarams:xml:ns:xmpp-stanzas"/></error></iq>

    IF username and password is correct i got below reponse from server

    <iq type="result" id="auth2" to="mskumar@sumanth/globe"/>

    and i have doudt what </resource> i need to use in resource tag..iam going in correct path?...as i seen in server i cant get any user online...what next step we need to do..

    thanks.

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to develop XMPP client for symbian

    You need not re-send '<?xml version='1.0' encoding='utf-8'?>'. It is required only at the very beginning.
    Otherwise the communication seems to be fine, but I do not know what is the default authorization mechanism, and I used PLAIN only.

  14. #14
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    Hi wizard ,the way i sending message to server is correct or i need to use any authenticating with a server using SASL(section 6.5) or STARTTLS(section 5.3)

    as i seen in http://www.ietf.org/rfc/rfc3920.txt

    second client request to send server should be like this

    Client selects an authentication mechanism:

    <auth xmlns='urn:ietfarams:xml:ns:xmpp-sasl'
    mechanism='PLAIN'/> rather then mechanism='DIGEST-MD5'/>

    and what the code u sent about base64..where i need to use it..

    can u send me some docs or link...the way i need to send request for authentication

  15. #15
    Regular Contributor
    Join Date
    May 2006
    Posts
    123

    Thumbs up Re: How to develop XMPP client for symbian

    Hi wizard,
    I handled atlast to connect with username and password.i getting response
    <success xmlns="urn:ietfarams:xml:ns:xmpp-sasl"/> .But next iam trying to send set presence by below schema <presence><show>Available</show><status>anymessage</status></presence>" .
    But in reply iam getting <stream:error xmlns:stream="http://etherx.jabber.org/streams"><not-authorized xmlns="urn:ietfarams:xml:ns:xmpp-streams"/></stream:error></stream:stream> with not-authorized ..what would be the problem.plz help me.Iam using Openfire server.

Similar Threads

  1. How to develop a web service client for Nokia communicator 9500?
    By tm09332 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2007-06-04, 14:48
  2. how to develop a sms client
    By vanitha in forum Mobile Java General
    Replies: 2
    Last Post: 2007-02-05, 04:55
  3. Bluetooth client problem on games!
    By wmchan78 in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2006-03-22, 06:15
  4. how to develop VPN client?
    By yinjialiang in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2003-07-25, 02:20
  5. Develop a Client which can render a MMS?
    By gautamkhullar in forum General Messaging
    Replies: 1
    Last Post: 2002-08-26, 10:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •