title: How to return ArrayList as SoapObject
body: <p>Iam new to Android and stuck up with something for past couple of days.
  Iam retreiving <code>CandidateNames</code> from database and storing it to my <code>ArrayList</code> which is in a <code>WebService</code> and returning the <code>ArrayList</code> to Java Client.</p>
  
  <p><code>WebService</code> with <code>ArrayList</code>:</p>
  
  <pre><code>public  ArrayList&lt;String&gt; DisplayName(){
      ArrayList&lt;String&gt;  results= new ArrayList&lt;String&gt;(); 
      try {
          String connectionURL = "jdbc:mysql://localhost/databaseName";
          Connection connection = null;
          Statement statement = null;
          ResultSet rs = null;
          Class.forName("com.mysql.jdbc.Driver").newInstance();
          connection=DriverManager.getConnection(connectionURL,"username","pswd");
          statement = connection.createStatement();
  
          String QueryString = "Select CName From CMaster where cid='xyz'";
          rs = statement.executeQuery(QueryString);
  
          while (rs.next()) {
              results.add(rs.getString(1));
          }
  
          rs.close();
          connection.close();
      } catch (Exception e) {
          e.printStackTrace();
      }
  
      return results;
  }
  </code></pre>
  
  <p><strong>Java Code:</strong></p>
  
  <pre><code>SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);            
  HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
  androidHttpTransport.debug = true; 
  envelope.setOutputSoapObject(request);
  
  try {
      androidHttpTransport.call(SOAP_ACTION, envelope);
      SoapPrimitive response = (SoapPrimitive)envelope.getResponse();    
      System.out.println("Response:::::::::::::" +result);
  }
  </code></pre>
  
  <p>This gives me only the first value of my <code>ArrayList</code>.
  When I replace: <code>SoapPrimitive response = (SoapPrimitive)envelope.getResponse();</code> with</p>
  
  <p><code>SoapObject result= (SoapObject)envelope.getResponse();
                   System.out.println("Response:::::::::::::" +result.getProperty(0));</code>
  it throws the following <code>exception</code>:</p>
  
  <pre><code>java.lang.classcastexception org.ksoap2.serialization.soapprimitive cannot be cast to org.ksoap2.serialization.soapObject
  </code></pre>
  
  <p>I Googled and tried every possible thing,please help me out if i missed out something.
  Thanks in advance!</p>