Question

When I use String[] a for add property in SoapSerializationEnvelope ,return error

 SoapObject request = new SoapObject(NAMESPACE, METHOD_SendArray);       

              //Use this to add parameters
              String[] a ={"21","22","23","66"};
              long[] x= new long[] { };
              request.addProperty("NumberList",a);
              request.addProperty("ID",x);

              //Declare the version of the SOAP request
              SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

              envelope.setOutputSoapObject(request);
              envelope.dotNet = true;

request body :

SendArray{NumberList=[Ljava.lang.String;@4052fa20; ID=[J@4052fb28; }

Error :

java.lang.RuntimeException: Cannot serialize: [Ljava.lang.String;@4052fa20
Was it helpful?

Solution

It can be possible..

Try this link :) It is helpful to me too.

Serialize an array of ints to send using KSOAP2

OTHER TIPS

Type String[] isn't serializable in term of ksoap library. See this link for information about sending arrays of data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top