title: KSOAP2 with array response parsing
body: <p>I have problem when parsing ksoap response.</p>
  
  <p><strong>Request Dump:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:server" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
     &lt;SOAP-ENV:Body&gt;
        &lt;tns:get_event&gt;
           &lt;phone xsi:type="xsd:string"&gt;7827701616&lt;/phone&gt;
        &lt;/tns:get_event&gt;
     &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p><strong>Response Dump:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:server" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
     &lt;SOAP-ENV:Body&gt;
        &lt;ns1:get_eventResponse xmlns:ns1="urn:server"&gt;
           &lt;return xsi:type="tns:events_data"&gt;
              &lt;events xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:events[3]"&gt;
                 &lt;item xsi:type="tns:events"&gt;
                    &lt;groom xsi:type="xsd:string"&gt;sanskaar&lt;/groom&gt;
                    &lt;bride xsi:type="xsd:string"&gt;saumya&lt;/bride&gt;
                    &lt;event_name xsi:type="xsd:string"&gt;wedding&lt;/event_name&gt;
                    &lt;venue xsi:type="xsd:string"&gt;New Delhi&lt;/venue&gt;
                    &lt;event_date xsi:type="xsd:string"&gt;Tuesday April 14, 2014&lt;/event_date&gt;
                 &lt;/item&gt;
                 &lt;item xsi:type="tns:events"&gt;
                    &lt;groom xsi:type="xsd:string"&gt;sanskaar&lt;/groom&gt;
                    &lt;bride xsi:type="xsd:string"&gt;saumya&lt;/bride&gt;
                    &lt;event_name xsi:type="xsd:string"&gt;hzbrgbj&lt;/event_name&gt;
                    &lt;venue xsi:type="xsd:string"&gt;New Delhi&lt;/venue&gt;
                    &lt;event_date xsi:type="xsd:string"&gt;Tuesday April 14, 2014&lt;/event_date&gt;
                 &lt;/item&gt;
                 &lt;item xsi:type="tns:events"&gt;
                    &lt;groom xsi:type="xsd:string"&gt;sanskaar&lt;/groom&gt;
                    &lt;bride xsi:type="xsd:string"&gt;saumya&lt;/bride&gt;
                    &lt;event_name xsi:type="xsd:string"&gt;wedding&lt;/event_name&gt;
                    &lt;venue xsi:type="xsd:string"&gt;New Delhi&lt;/venue&gt;
                    &lt;event_date xsi:type="xsd:string"&gt;Tuesday April 14, 2014&lt;/event_date&gt;
                 &lt;/item&gt;
              &lt;/events&gt;
           &lt;/return&gt;
        &lt;/ns1:get_eventResponse&gt;
     &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Activity code for parsing response:</p>
  
  <pre><code>ht.call(SOAP_ACTION, envelope);
  SoapObject response = (SoapObject) envelope.getResponse();
  System.out.print(response);//getting output here checked by debugging
  
  for(int i=0;i&lt;response.getPropertyCount();i++){    
         Object property = response.getProperty(i);
         if(property instanceof SoapObject)//returning false
         {
             SoapObject final_object = (SoapObject) property;
             String groom = final_object.getProperty("groom").toString();
      }
  }
  </code></pre>
  
  <p>I am getting response of KSOAP response but i am not able to understand why i am unable to parse response.</p>
  
  <p>Code execute without error but not enters in <code>If</code> condition because of <code>property instanceof SoapObject</code> returning false.</p>
  
  <p>Why is this? Guide me please</p>