Menu

Add or remove friend fails.

Help
2010-11-10
2013-04-29
  • Sofus Albertsen

    Sofus Albertsen - 2010-11-10

    Hey all.
    I would very much appreciate some help in this matter:
    I have a class MSNConnection that implements MsnContactListListener, MsnMessageListener, MsnMessengerListener, MsnSwitchboardListener
    My goal is to delete all former friends of the MSN contact at startup, and then add some new from a list.
    I can add my code if someone needs it, but the overall case is this:
    In the contactlistInitComplete method i have this piece of code:
      

     System.out.println("ContactListInitCompleted");
        if(myFormerContacts==null){ 
        MsnContact[] list=messenger.getContactList().getContacts();
         myFormerContacts= new ArrayList<MsnContact>();
        for (int i = 0; i < list.length; i++) {
            System.out.println(list[i].getEmail().getEmailAddress());
            myFormerContacts.add(list[i]);
        }   }
            if(myFormerContacts.size()!=0){
                System.out.println("removed a friend in initcompleted");
                messenger.removeFriend(myFormerContacts.remove(0).getEmail(), true);
            }else if(myNewContacts.size()!=0){
                System.out.println("added a friend in initcompleted");
                messenger.addFriend(myNewContacts.remove(0), "");
            }
    

    But when the method is called i get a java.lang.ecxeption error saying this:

    10-11-2010 11:23:35 net.sf.jml.protocol.soap.ContactList sendRequest
    SEVERE: something wrong!
    java.lang.Exception
    at net.sf.jml.protocol.soap.ContactList.sendRequest(ContactList.java:276)
    at net.sf.jml.protocol.soap.ContactList.sendRequest(ContactList.java:160)
    at net.sf.jml.protocol.soap.ContactList.addFriend(ContactList.java:1244)
    at net.sf.jml.impl.SimpleMessenger.addFriend(SimpleMessenger.java:197)
    at dk.semaphor.im.agents.connections.MSNConnection.contactListInitCompleted(MSNConnection.java:169)
    at net.sf.jml.impl.AbstractMessenger.fireContactListInitCompleted(AbstractMessenger.java:533)
    at net.sf.jml.protocol.outgoing.OutgoingPNG.receivedResponse(OutgoingPNG.java:65)
    at net.sf.jml.protocol.MsnSession$1.messageReceived(MsnSession.java:114)
    at net.sf.jml.net.Session.fireMessageReceived(Session.java:301)
    at net.sf.jml.net.Session.access$1200(Session.java:30)
    at net.sf.jml.net.Session$MsgDispatcher.run(Session.java:283)
    at java.lang.Thread.run(Thread.java:662)
    10-11-2010 11:23:35 net.sf.jml.protocol.soap.ContactList sendRequest
    INFO: Error xml:<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Contact Already Exists </faultstring><faultactor>http://www.msn.com/webservices/AddressBook/ABContactAdd</faultactor><detail><errorcode xmlns="http://www.msn.com/webservices/AddressBook">ContactAlreadyExists</errorcode><errorstring xmlns="http://www.msn.com/webservices/AddressBook">Contact Already Exists </errorstring><machineName xmlns="http://www.msn.com/webservices/AddressBook">BY2ABCHWB270</machineName><additionalDetails><conflictObjectId>5A2EF788-3234-44B2-8897-BD19B631410C</conflictObjectId></additionalDetails></detail></soap:Fault></soap:Body></soap:Envelope>

    Can someone point out where the program is broken, or has it something to do with JML itself?  i'm using protocoll 15 if that has something to do with it.
    Thank you in advance!

     
  • Inshua

    Inshua - 2011-03-26

    i meet this problem too.

    when somebody send a pending message to the robot , and unfortunely  the robot is not online,  next time the robot  sign in, it will receive pending message, but how to accept this invition is a strange problem.

    i found a c# library of msn messenger named MSNPSharp,  it send a delete contract message at first. but it's still hard for me to do the same thing in jml.  so i just put this clues here, hope it's helpful.

     
  • Nathan Crause

    Nathan Crause - 2011-10-20

    The solution I use is to force JML to use protocol 12:

    msn.setSupportedProtocol(new MsnProtocol[] {MsnProtocol.MSNP12});
    

    This is because protocol 13 and up use the SOAP calls, which seem buggy.

     
  • fielding

    fielding - 2011-11-09

    Thanks, ncrause. It fixed my issue also….

     
  • Suresh K Jangir

    Suresh K Jangir - 2011-11-23

    But using MSNP12 have problem with receiving offline messages.
    Is there any solution for that ?

     
  • Damian Minkov

    Damian Minkov - 2011-11-23

    MSNP12 don't support offline messages. Its MSNP13 and later those that support it.

     
  • jayyouth

    jayyouth - 2011-12-15

    i meet this problem too,
    if i want to use MSNP15, how can i fix this issue?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.