title: How to serialize xml-object in string array in Java with KSOAP?
body: <p>I have response from server (WSDL SOAP) with following code:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Content-Type: text/xml; charset=utf-8
  Content-Length: length
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;GetChanelResponse xmlns="http://tempuri.org/"&gt;
        &lt;GetChanelResult&gt;
          &lt;string&gt;string&lt;/string&gt;
          &lt;string&gt;string&lt;/string&gt;
        &lt;/GetChanelResult&gt;
      &lt;/GetChanelResponse&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>I try to use this code for getting string array:</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Hashtable;
  import java.util.Vector;
  
  import org.ksoap2.serialization.KvmSerializable;
  import org.ksoap2.serialization.PropertyInfo;
  
  
  public class XMLRez extends Vector implements KvmSerializable{
  
      private static final long serialVersionUID = -1166006770093411055L;
  
      @Override
      public Object getProperty(int arg0) {
          // TODO Auto-generated method stub
          return this.get(arg0);
      }
  
      @Override
      public int getPropertyCount() {
          // TODO Auto-generated method stub
          return this.size();
  
      }
  
      @Override
      public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
          // TODO Auto-generated method stub
          arg2.name = "string";
          arg2.type = PropertyInfo.STRING_CLASS;
  
      }
  
      @Override
      public void setProperty(int arg0, Object arg1) {
          // TODO Auto-generated method stub
          this.add(arg1.toString());
      }
  }
  </code></pre>
  
  <p>This class is used for data storage.</p>
  
  <pre><code>public class Main {
  
      public static String SOAP_ACTION="http://tempuri.org/GetChanel";
      public static String METHOD_NAME="GetChanel";
      public static String NAMESPACE="http://tempuri.org/";
      public static String URL="http://www.mcds.co.il/YouTube/ChanelApi.asmx";
  
      /**
       * @param args
       */
      public static void main(String[] args) {
  
          XMLRez documentIdVector=new XMLRez();
  
  
          PropertyInfo documentIdsPropertyInfo = new PropertyInfo();
          documentIdsPropertyInfo.setName("GetChanelResult");
          documentIdsPropertyInfo.setValue(documentIdVector);
          documentIdsPropertyInfo.setType(documentIdVector.getClass());
  
          // TODO Auto-generated method stub
          SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
          request.addProperty(documentIdsPropertyInfo);
          //request.addProperty("Celsius", "5");
  
          SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
  
          envelope.dotNet=true;      
          envelope.setOutputSoapObject(request);
          envelope.addMapping(NAMESPACE, "GetChanelResult", new XMLRez().getClass());
  
          //AndroidHttpTransport aht=new AndroidHttpTransport(URL);
          HttpTransportSE aht =new HttpTransportSE(URL);
  
          try {
              aht.call(SOAP_ACTION, envelope);
              XMLRez prim=(XMLRez)envelope.bodyIn;
          } catch (Exception e) {
              //Log.e("exp", e.getMessage());
              System.out.println(e.getMessage());
          }
      }
  
  }  
  </code></pre>
  
  <p>This class I use for getting data from service. But I always get exception "org.ksoap2.serialization.SoapObject cannot be cast to XMLRez". Where can I make mistake?</p>