title: How to get data from body using KSOAP2 - android
body: <p>I am am trying to connect to a SOAP web service using ksoap2 library. I have read a bunch of docs about it, but finally he showing me null array please help me.</p>
  
  <pre><code>POST /musicappservice.asmx HTTP/1.1
  Host: musicappwebservice.dev07.company.com
  Content-Type: text/xml; charset=utf-8
  Content-Length: length
  SOAPAction: "http://company.com/wsAppCategory"
  
  &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;wsAppCategory xmlns="http://company.com/"&gt;
        &lt;json&gt;string&lt;/json&gt;
      &lt;/wsAppCategory&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  
  
  
  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;wsAppCategoryResponse xmlns="http://company.com/"&gt;
        &lt;wsAppCategoryResult&gt;string&lt;/wsAppCategoryResult&gt;
      &lt;/wsAppCategoryResponse&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>this are the web services i m using </p>
  
  <p>Java Code Here </p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      tv = (TextView) findViewById(R.id.tv_result);
      b = (Button) findViewById(R.id.button1);
      b.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {
              AsyncCallWS task = new AsyncCallWS();
              task.execute();
          }
      });
  }
  
  public void Sonsgs_category(String songs_cat) {
      //Create request
      SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
      Log.i("i = ",""+request);
  
      //Property which holds input parameters
  
      PropertyInfo AppDevId =new PropertyInfo();
      AppDevId.name = "AppDevId";
      AppDevId.setValue("24");
      request.addProperty(AppDevId);
      Log.i("AppDevId = ",""+AppDevId);
  
      PropertyInfo UserId =new PropertyInfo();
      UserId.name = "UserId";
      UserId.setValue("1");
      request.addProperty(UserId);
      Log.i("UserId = ",""+UserId);
  
      //Create envelope
      SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
      envelope.dotNet = true;
      //Set output SOAP object
      envelope.setOutputSoapObject(request);
      //Create HTTP call object
      HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
  
      try {
          androidHttpTransport.call(SOAP_ACTION, envelope);
          SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
          jsonarray = response.toString();
          Log.i("jsonarray = ",""+jsonarray);
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  
  private class AsyncCallWS extends AsyncTask&lt;String, Void, Void&gt; {
      @Override
      protected Void doInBackground(String... params) {
          Log.i(TAG, "doInBackground");
          Sonsgs_category(celcius);
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          Log.i(TAG, "onPostExecute");
          tv.setText(jsonarray);
      }
  
      @Override
      protected void onPreExecute() {
          Log.i(TAG, "onPreExecute");
          tv.setText("Loading...");
      }
  
      @Override
      protected void onProgressUpdate(Void... values) {
          Log.i(TAG, "onProgressUpdate");
      }
  
  }
  </code></pre>