sendRegistrationFields problem

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>

Hi,

Is this 3.1.0 release or latest code from trunk?

Is the server supporting user registration?

It‘s 3.1.0 release.

The server is ok. I registered an account with Spark successfully, but I can’t register using my code, and When I logined with an existed account, connection.registrationSupported became true.

Sorry for my poor English.

Could you post the stream:features XML coming from the server?

<stream:features>
          <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls">
          </starttls>
          <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
                    <mechanism>DIGEST-MD5</mechanism>
                    <mechanism>PLAIN</mechanism>
                    <mechanism>ANONYMOUS</mechanism>
                    <mechanism>CRAM-MD5</mechanism>
          </mechanisms>
          <compression xmlns="http://jabber.org/features/compress">
                    <method>zlib</method>
          </compression>
          <auth xmlns="http://jabber.org/features/iq-auth"/>
          <register xmlns="http://jabber.org/features/iq-register"/>
</stream:features>