List of properties with Soapobject on Android

Asked

Viewed 14 times

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?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.