Android: SoapObject replace a property value -
in 1 of project using ksoap2
library.
i have find way update value particular key added soapobject
, either
a) removing key/value soapobject
, adding key again new value
or
b) updating value of existing key
for example, have soapobject
similar below data,
savexxxxrecord{referenceno=tp002011; reportdatetime=2016-02-29 12:13; notes=test; tokenid=2760dad08feb5c8b553ad02c; }
i have replace value of tokenid
new value.
i used following code update value in soapobject,
private synchronized static void updateproperty(soapobject request, string name, string value) { try { for(int i=0; < request.getpropertycount(); i++) { propertyinfo pidata = new propertyinfo(); request.getpropertyinfo(i, pidata); if (commonfunctions.ifstringssame(name, pidata.name)) { pidata.setvalue(value); request.setproperty(i, pidata.getvalue()); } } } catch (exception ex) { exceptionhelper.handleexception(ex); } }
Comments
Post a Comment