9 Replies Latest reply: Mar 29, 2007 10:32 PM by 807597 RSS

    Jymsg(java yahoo instant messenger api)

    807597
      I making instant messenger in java using socket programming and swing. I want in my messenger the service such as, all the users which are registered to my messenger, can talk to the online friends of my messenger as well as the friends which are online on yahoo messneger as well.
      I have make my messenger with my own sending and receiving device, but i don't know how to procced further.By searching through net i got a api JYMSG(java yahoo instant messenger api) which allow to connect to yahoo server and chat with the online friends.But i don't form where to start and how to start making such appilication.
      if anyone has any idea about connecting to yahoo server please
      reply me i will be very thankful to him/her.It would be really great help for me , whatever be your reply.
      Waiting anxiously for replies
      ThankYou for Replies
      alok
        • 1. Re: Jymsg(java yahoo instant messenger api)
          807597
          JYMSG API contains a good library for doing such things. Using its library, you can simply do all tasks you do manually in yahoo messenger.
          Just search for tutorials and read its api documentation.

          For the start point of your project, try to write a simple application which logs in to yahoo using specified ID and password, and sends an instant message to another yahoo user. Development should be easy after that.

          Regards
          • 2. Re: Jymsg(java yahoo instant messenger api)
            807597
            Do you ever use this api, Because i have the documentation of this api but there is problem while using it. when i tried to login to yahoo server using method login(String user, String pass) i get timeout exception, will please help me to know what's the problem.
            Regards alok
            • 3. Re: Jymsg(java yahoo instant messenger api)
              807597
              Yes, I used it a couple of years ago !
              Be sure to get the latest release, since Yahoo! inc. performs minor changes to its YMSG protocol regularly. I'm not sure, but timeout exceptions are normally caused by network problems.
              You should have no problems using jYMSG, just search for tutorials on the web.
              • 4. Re: Jymsg(java yahoo instant messenger api)
                807597
                Thank you for reply ,
                I got tutorial from http://jymsg.sourceforge.net, Wil you please tell me from where to start making messenger as i am not able to logged in to the yahoo messenger
                Thank you for replies
                alok
                • 5. Re: Jymsg(java yahoo instant messenger api)
                  807597
                  As I said before, you have to ensure that timeout exception is not caused by a network problem. Were I you, I would launch a sniffer and monitor what jYMSG really does for connecting to Yahoo messaging server. Then I would try it myself, without using the API.

                  For example, if you find out that jYMSG tries to connect to server.yahoo.com on port 5050, try to establish a simple connection using sockets.

                  For more details, you can refer to these documents :

                  http://planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=55506&lngWId=1
                  http://en.wikipedia.org/wiki/Yahoo!_Messenger_Protocol
                  • 6. Re: Jymsg(java yahoo instant messenger api)
                    807597
                    Thanx mate for such help,
                    Actually, I am a college boy , i connect to internet through college
                    proxy server , as i run application using jymsg in college campus
                    i am not able to connect to it.But when i tried to connect through
                    dial up through mobile am able to run my application easily.
                    now please tell me if it is possible to connect to yahoo server
                    using jymsg api , through college proxy, if yes then please tell
                    me how i am able to do it.
                    Thanx again.

                    Message was edited by:
                    alok_agrawal
                    • 7. Re: Jymsg(java yahoo instant messenger api)
                      807597
                      I told you, it was a network problem.

                      Yahoo Messenger provides 3 methods for connecting to its server. Straight connection, Proxy connection, and HTTP connection. You have to find out if college's proxy server blocks connections over non-http protocols. If it allows these connections, then you will be able to login using the Yahoo messenger itself using the socks proxy your college provided. On the other side, you can simply set your Java environment properties to use this proxy server for creating sockets.

                      You can also connect using the HTTP protocol, which is definitely not blocked by your college's proxy server. But remember that you still have to use your HTTP proxy server by setting your environment properties. I don't know whether jYMSG support http connections, read it's manual.
                      • 8. Re: Jymsg(java yahoo instant messenger api)
                        807597
                        Than you for reply,
                        I tried to do through Http method provided by JYMSG9, But still i am getting the same error i am sending the problem area will you please tell me where i was wrong
                        .
                        .
                        .
                        {
                        HTTPConnectionHandler http=new HTTPConnectionHandler("http.webs.ssgmce.ac.in",3128);
                        }
                        public void login() {
                                  connectionClosed = false;
                                  if (loggedIn == false) {
                                       yahooMessengerSession = new Session(http);
                                       mySessionListener = new MySessionListener(this);
                                       yahooMessengerSession.addSessionListener(mySessionListener);
                                       String userName = getUserNameTextField().getText();
                                       String password = getPasswordTextField().getText();
                                       try
                                       {
                                            if ((userName.equals("")) || (password.equals("")))
                                            {
                                                 System.out.println("User name/password is blank");
                                            }
                                            else {
                                                 System.out.println("Attempting login");
                                                 yahooMessengerSession.login(userName, password);
                                                 System.out.println("Username: " + userName);
                                                 System.out.println("Password: " + password);
                                                 System.out.println("ConnectionClosed" + connectionClosed);
                                                 if (connectionClosed==false)
                                                 {
                                                      setViewable();
                                                 }
                                                 else
                                                 {
                                                      setUnviewable();
                                                 }
                                                 
                                            }

                                       } catch (IllegalStateException e1) {
                                            System.out.println("I am here!!!");
                                            getStatusLabel().setText("Login Failed");

                                            e1.printStackTrace();
                                            loggedIn = false;
                                            connectionClosed = false;
                                       } catch (AccountLockedException e1) {
                                            e1.printStackTrace();
                                       } catch (LoginRefusedException e1) {
                                            getStatusLabel().setText("Login Failed");
                                            loggedIn = false;
                                            e1.printStackTrace();
                                       } catch (IOException e1) {
                                            // TODO Auto-generated catch block
                                            e1.printStackTrace();
                                       }

                                  } else {
                                       System.out.println("Attempting logout");
                                       logout();

                                  }

                             }
                        The code is downloaded code , But it is not able to log in please tell me where is the error, Where changes are required.
                        Waiting anxiuosly for reply

                        alok
                        • 9. Re: Jymsg(java yahoo instant messenger api)
                          807597
                          hi buddy,
                          What happen are you not read my previous post, If then please read it, give me the solution of my
                          problem, i will be very thankful to you , I read the manual and tried to connect to yahoo through proxy
                          by using HTTPConnectionHandler class, but i am not able to connect to it , and our college does'nt provide any other protocol through proxy server, Now please guide me how to proceed further
                          Thank you for reply
                          alok