0

I want to parse the below given data using resultsRequestSOAP object in order to display the message "registered successfully" if the log-cat responsecode== 1, "try again"if response is 0 in my activity, I tried a lot to show the dialog box according to the logcat response but as I am new to android I couldn't able to do that. please some one help me with code snippet if possible.
I m getting the responses 1,0 in my logcat but with this I want to display the alert dialog box in my activity

Help is always appreciated...!

request.addProperty("email", email);
request.addProperty("contact", contact);
request.addProperty("fname", fname);
request.addProperty("lname", lname);
request.addProperty("gender", gender);
request.addProperty("dateofbirth", dob);
request.addProperty("password", password);
request.addProperty("latitude", 76);
request.addProperty("longitude", 82);
request.addProperty("device_id", "12345"); 

aht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 
aht.call(SOAP_ACTION, soapEnvelope);

SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;
Log.v("TAG", String.valueOf(resultsRequestSOAP));
Raj
  • 55
  • 3
  • 10
  • can you give us the xml response ?? it would be easier but Soapobject cotain other soapbojects like the xml. – PedroAGSantos Jun 27 '11 at 06:58
  • @subspider, Hi, in logcat I m getting the following response, RegisterUserResponse{RegisterUserResult=1; } here after checking the response I want to show the message like "Registered successfully" – Raj Jun 27 '11 at 07:01
  • RegisterUserResponse{RegisterUserResult=1; then sucessfully registerd RegisterUserResponse{RegisterUserResult=0; database error/already registerd , RegisterUserResponse{RegisterUserResult= -1; field is empty , these r the three possible cases in logcat response – Raj Jun 27 '11 at 07:14

1 Answers1

0
int result = Integer.valueOf(resultsRequestSOAP.getProprety("RegisterUserResult"));

if not working try

resultsRequestSOAP = (SoapObject)resultsRequestSOAP.getProprety(0);
int result = Integer.valueOf(resultsRequestSOAP.getProprety("RegisterUserResult").toString());

I think that's it

PedroAGSantos
  • 2,336
  • 2
  • 17
  • 34
  • Thanks a lot for ur response, I m getting the response as 1 in logcat. using this I want to show the dialog box in my activity, I mean if response = 1 then SUCCESS otherwise TRYAGAIN. how to do this?(my actual requirement) – Raj Jun 27 '11 at 07:26
  • @Raj good well if you go here http://stackoverflow.com/questions/2257963/android-how-to-show-dialog-to-confirm-user-wishes-to-exit-activity use these – PedroAGSantos Jun 27 '11 at 07:43
  • @Raj if you couldn't do it tell me ok – PedroAGSantos Jun 27 '11 at 08:00
  • I tried it But I couldn't, I think I should use asynctask to do this. – Raj Jun 27 '11 at 08:59