code:
connection = new XMPPConnection(); connection.addEventListener(ConnectionSuccessEvent.CONNECT_SUCCESS,ConnectionSuccess); connection.server = "127.0.0.1"; connection.port = 5222; connection.connect(); private function onConnectionSuccess(event:ConnectionSuccessEvent):void {
var inBandRegistrator = new InBandRegistrator(connection);
connection.addEventListener(RegistrationSuccessEvent.REGISTRATION_SUCCESS,onRegistrationSuccess);
var fields:Object = new Object();
fields.username = "aaa";
fields.password = "aaa";
inBandRegistrator.sendRegistrationFields(fields); }
but connection.registrationSupported = false,so I received a message from host bellow:
<iq type="error" id="reg_attempt_1" from="127.0.0.1" to="airycanon-pc/c72eda98">
<query xmlns="jabber:iq:register">
<username>aaa</username>
<password>aaa</password>
</query>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>