ksoap2 - Parse Ksoap response array in android -
i want parse ksoap response array not getting it
response when debug app:
events_data { events = [events { groom = sanskaar; bride = saumya; event_name = wedding; venue = new delhi; event_date = tuesday april 14, 2014; }, events { groom = sanskaar; bride = saumya; event_name = hzbrgbj; venue = new delhi; event_date = tuesday april 14, 2014; }, events { groom = sanskaar; bride = saumya; event_name = wedding; venue = new delhi; event_date = tuesday april 14, 2014; } ]; }
code using parse response:
soapobject response = (soapobject) envelope.getresponse(); //soapobject response = (soapobject) envelope.bodyin; system.out.print(response); int count = response.getpropertycount(); system.out.print(count); for(int i=0;i<response.getpropertycount();i++){ object property = response.getproperty(i); if(property instanceof soapobject){ soapobject final_object = (soapobject) property; //parsing response data event_data.put("groom", final_object.getproperty("groom").tostring()); system.out.print(event_data);//testing of response data } }
(property instanceof soapobject) giving false
. code not parse response.
while parsing following response same activity code working good:
data { user = user { id = 39; user_name = ; email = ; phone = 7827701616; address = ; url = ; user_role = 1; plan = 1; verification_pin = 18053; status = 1; android_id = 38d23c7201b21f93; }; }
help me this.
try code buddy:
soapobject response = (soapobject) envelope.getresponse(); //soapobject response = (soapobject) envelope.bodyin; system.out.print(response); int count = response.getpropertycount(); system.out.print(count); for(int i=0;i<response.getpropertycount();i++){ object property = response.getproperty(i); if(property instanceof soapobject){ soapobject final_object = (soapobject) property; for(int j=0; j<final_object.getpropertycount();j++){ object final_property = final_object.getproperty(j); if(final_property instanceof soapobject){ soapobject array_object = (soapobject) final_property; //parsing response data event_data.put("groom",array_object.getproperty("groom").tostring()); } } system.out.print(event_data);//testing of response data } }
Comments
Post a Comment