How to get string array with KSOAP2 in Java, Android?
<p>I use KSOAP2 library, and web-service returns me string array:</p>

<pre><code>  &lt;GetChanelResult&gt;
    &lt;string&gt;
        string
    &lt;/string&gt;
    &lt;string&gt;
        string
     &lt;/string&gt;
  &lt;/GetChanelResult&gt;
</code></pre>

<p>But how can I transform Object (which I got with envelope.getResponce()) to string array? Thank you.</p>

<p>I have the code:</p>

<pre><code>package com.nda.ut;

import java.io.IOException;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;
import org.xmlpull.v1.XmlPullParserException;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;

public class UTPlayerActivity extends Activity {
    /** Called when the activity is first created. */

    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";

    TextView view;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);
        view=(TextView)findViewById(R.id.view);

        SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);


        SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet=true;
        envelope.setOutputSoapObject(request);

        AndroidHttpTransport aht=new AndroidHttpTransport(URL);

        try {
            aht.call(SOAP_ACTION, envelope);
            SoapPrimitive result=(SoapPrimitive)envelope.getResponse();
            //if (result!=null)
            view.setText("123");

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            Log.e("IO", "1");
        } catch (XmlPullParserException e) {
            // TODO Auto-generated catch block
            Log.e("XmlPullParser", "2");
        }
    }
}
</code></pre>

<p>But this code returned exception</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  &lt;wsdl:types&gt;
    &lt;s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"&gt;
      &lt;s:element name="GetChanel"&gt;
        &lt;s:complexType /&gt;
      &lt;/s:element&gt;
      &lt;s:element name="GetChanelResponse"&gt;
        &lt;s:complexType&gt;
          &lt;s:sequence&gt;

            &lt;s:element minOccurs="0" maxOccurs="1" name="GetChanelResult" type="tns:ArrayOfString" /&gt;
          &lt;/s:sequence&gt;
        &lt;/s:complexType&gt;
      &lt;/s:element&gt;
      &lt;s:complexType name="ArrayOfString"&gt;
        &lt;s:sequence&gt;
          &lt;s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" /&gt;
        &lt;/s:sequence&gt;
      &lt;/s:complexType&gt;

    &lt;/s:schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name="GetChanelSoapIn"&gt;
    &lt;wsdl:part name="parameters" element="tns:GetChanel" /&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetChanelSoapOut"&gt;
    &lt;wsdl:part name="parameters" element="tns:GetChanelResponse" /&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name="ChanelApiSoap"&gt;

    &lt;wsdl:operation name="GetChanel"&gt;
      &lt;wsdl:input message="tns:GetChanelSoapIn" /&gt;
      &lt;wsdl:output message="tns:GetChanelSoapOut" /&gt;
    &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:binding name="ChanelApiSoap" type="tns:ChanelApiSoap"&gt;
    &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
    &lt;wsdl:operation name="GetChanel"&gt;
      &lt;soap:operation soapAction="http://tempuri.org/GetChanel" style="document" /&gt;

      &lt;wsdl:input&gt;
        &lt;soap:body use="literal" /&gt;
      &lt;/wsdl:input&gt;
      &lt;wsdl:output&gt;
        &lt;soap:body use="literal" /&gt;
      &lt;/wsdl:output&gt;
    &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:binding name="ChanelApiSoap12" type="tns:ChanelApiSoap"&gt;

    &lt;soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
    &lt;wsdl:operation name="GetChanel"&gt;
      &lt;soap12:operation soapAction="http://tempuri.org/GetChanel" style="document" /&gt;
      &lt;wsdl:input&gt;
        &lt;soap12:body use="literal" /&gt;
      &lt;/wsdl:input&gt;
      &lt;wsdl:output&gt;
        &lt;soap12:body use="literal" /&gt;
      &lt;/wsdl:output&gt;

    &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:service name="ChanelApi"&gt;
    &lt;wsdl:port name="ChanelApiSoap" binding="tns:ChanelApiSoap"&gt;
      &lt;soap:address location="http://www.mcds.co.il/YouTube/ChanelApi.asmx" /&gt;
    &lt;/wsdl:port&gt;
    &lt;wsdl:port name="ChanelApiSoap12" binding="tns:ChanelApiSoap12"&gt;
      &lt;soap12:address location="http://www.mcds.co.il/YouTube/ChanelApi.asmx" /&gt;
    &lt;/wsdl:port&gt;

  &lt;/wsdl:service&gt;
&lt;/wsdl:definitions&gt;
</code></pre>

<p>This code for page</p>
