hi,
I am trying to build a very basic one2one chat based on XIFF3 and I am learning Flex2 along the process. I’ve buit a very simple client until now by reading the Sparkweb source code and trying to understand how it works, and also by taking some ideas from Paazmaya’s links here (http://www.igniterealtime.org/community/thread/32922).
The problem is I am getting a policy-violation error, this exception is thrown by the XIFFErrorEvent error handler. I have no idea how to locate the exact error nor when it happens since I am a very Flex & XIFF beginner. I just thought it has to do with the connection process and how to set the policy file, so here is the code I use to connect :
// set event handlers
connection.addEventListener(ConnectionSuccessEvent.CONNECT_SUCCESS, doConnectionSuccess);
connection.addEventListener(DisconnectionEvent.DISCONNECT, onDisconnection);
connection.addEventListener(LoginEvent.LOGIN , onLogin);
connection.addEventListener(PresenceEvent.PRESENCE, onPresence);
connection.addEventListener(XIFFErrorEvent.XIFF_ERROR, onXiffError);
connection.addEventListener(MessageEvent.MESSAGE, onMessage);
// connection args
connection.username = “hbr”;
connection.password = “123”;
connection.server = Server.toString();
connection.port = 7070 ;
connection.resource = resourceName;
Security.loadPolicyFile(“xmlsocket://” + Server.toString() + “:5229”);
Security.allowDomain( “*” );
Security.allowInsecureDomain("*");
connection.connect(“flash”);
// disable anonymous login
XMPPBOSHConnection.disableSASLMechanism(“ANONYMOUS”);
/code
Any thoughts ?