0
I have the following parameter structure in the webservice, and the Alistafoto parameter is a list (array):
<parameters>
<NCodCli></NCodCli>
<AListaFoto>
<AFoto></AFoto>
</AListaFoto>
</parameters>
Using soapObject:
SoapObject params = new SoapObject();
params.addProperty("NCodCli", codCli);
SoapObject paramFoto = new SoapObject();
for (Bitmap bitmap : lFotos) {
byte[] bImg = Functions.bitmapToByteArrayOutputStream(bitmap).toByteArray();
String b64 = Base64.getEncoder().encodeToString(bImg);
paramFoto.addProperty("AFoto", b64);
}
params.addProperty("AListaFoto", paramFoto);
This way I did a test with 5 photos, filling the Alistafoto. But in the webservice there is only one single child "Afoto", being the last image loaded. It is as if the loop overwritten the same parameter, remaining only one.
How to create this loop by adding several in using soapObject?