I'm trying to integrate xmpp with java web services. But it pops some errors. How to overcome with this ? This is my code.
import java.util.*; import org.jivesoftware.smack.Chat; import org.jivesoftware.smack.ConnectionConfiguration; import org.jivesoftware.smack.MessageListener; import org.jivesoftware.smack.Roster; import org.jivesoftware.smack.RosterEntry; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.Message; public class Function implements MessageListener { XMPPConnection connection; public String[] login(String userName, String password) { try { ConnectionConfiguration config = new ConnectionConfiguration( "host", port, "Work"); connection = new XMPPConnection(config); connection.connect(); connection.login(userName, password); } catch (XMPPException e) { System.out.println(e); } return displayBuddyList(); } public String[] displayBuddyList() { Roster roster = connection.getRoster(); Collection<RosterEntry> entries = roster.getEntries(); String[] buddy = new String[entries.size()]; int i = 0; for (RosterEntry r : entries) { buddy[i] = r.getUser(); i++; } return buddy; } public void sendMessage(String message, String to) { try { Chat chat = connection.getChatManager().createChat(to, this); chat.sendMessage(message); } catch (XMPPException e) { System.out.println(e); } } public void disconnect() { connection.disconnect(); } @Override public void processMessage(Chat chat, Message message) { if (message.getType() == Message.Type.chat) System.out.println(chat.getParticipant() + " says: " + message.getBody()); } } -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/1hAZI1B4TxQJ. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.