xmpp - Getting bad request 400 error using asmack in android -


i trying register new user using xmpp client using asmack library in android on ejabberd server. problem getting following error & user not being created on server:

bad-request(400) @ org.jivesoftware.smack.accountmanager.createaccount(accountmanager.java:243) @ in.ui.mainactivity$1$1$1.run(mainactivity.java:316) @ java.lang.thread.run(thread.java:841) 

following code:

_xmppusername = xmppconfig.getstringuserinfovalue (xmppconfig.xmpp_client_id); _xmpppassword = xmppconfig.getstringuserinfovalue (xmppconfig.xmpp_client_password); _xmpphost = xmppconfig.getstringuserinfovalue (xmppconfig.xmpp_host); try {     _xmppportno = integer.parseint (xmppconfig.getstringuserinfovalue (xmppconfig.xmpp_port)); } catch (exception e) {     e.printstacktrace ();     log.e (tag, e.getmessage ()); } _xmppservicename = xmppconfig.getstringuserinfovalue (xmppconfig.xmpp_service_name);  connectionconfiguration conconfig = new connectionconfiguration (_xmpphost, _xmppportno, _xmppservicename);  _xmppconnection = new xmppconnection (conconfig);  if (!_xmppconnection.isauthenticated ()) {     login (); } /*  * if connection has not been established or had been established &  * broken again login  */      @override     public void onshow (final dialoginterface dialog) {         button positivebutton = _dlgregistration.getbutton (dialoginterface.button_positive);         positivebutton.setonclicklistener (new view.onclicklistener () {             @override             public void onclick (view v) {                  // creating registration thread                 new thread (new runnable () {                     @override                     public void run () {                         string clientid = null;                         string password = null;                              clientid = "user" + xmpp_service_name;                             try {                                  // getting hash password uuid                                 password = "password";                                 log.i (tag, clientid + password);                             } catch (nosuchalgorithmexception e1) {                                 e1.printstacktrace ();                             } catch (unsupportedencodingexception e1) {                                 e1.printstacktrace ();                             }                         }                         accountmanager manager = _xmppconnection.getaccountmanager ();                         try {                                   // creating account on server                                 manager.createaccount (clientid, password, attr);                                                              }                         } catch (xmppexception e) {                             e.printstacktrace ();                         }                     }                 }).start ();             }         }); 

the problem line clientid = "user" + xmpp_service_name; shouldn't have been appending domain or service name after "user".


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -