title: How to send parameter while calling the method using ksoap parsing in android
body: <p>I am doing soap based parsing .I am able to get get response when there is no parameter in method .But Now I am calling function which having some parameter and returning a object.While trying I am getting null.I am call this function <strong>getDestinationStationDashboard</strong> and parameter is <strong>"HNH"</strong> </p>
  
  <p>Here is my code .</p>
  
  <pre><code>package com.example.soapbased;
  
  import org.ksoap2.SoapEnvelope;
  import org.ksoap2.serialization.PropertyInfo;
  import org.ksoap2.serialization.SoapObject;
  import org.ksoap2.serialization.SoapPrimitive;
  import org.ksoap2.serialization.SoapSerializationEnvelope;
  import org.ksoap2.transport.AndroidHttpTransport;
  
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.content.Context;
  import android.net.ConnectivityManager;
  import android.net.NetworkInfo;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.Toast;
  
  public class Soapclass extends Activity {
      private static final String SOAP_ACTION = "http://wsendpoints.bbrailapps.firstgroup.com/getDestinationStationDashboard";
      private static final String METHOD_NAME = "getDestinationStationDashboard";
      private static final String NAMESPACE = "http://wsendpoints.bbrailapps.firstgroup.com";
      private static final String URL = "http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl";
      private SoapObject resultRequestSOAP = null;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_soapclass);
          System.out.println("=====================" + haveNetworkConnection());
  
          new AsyncTask&lt;Void, Void, Object&gt;() {
              ProgressDialog dialog = new ProgressDialog(Soapclass.this);
              private PropertyInfo pi1;
  
              protected void onPreExecute() {
                  dialog.show();
              };
  
              protected Object doInBackground(Void[] params) {
  
                  /*resultRequestSOAP = new SoapObject(NAMESPACE, METHOD_NAME);
  
                  SoapSerializationEnvelope envp = new SoapSerializationEnvelope(
                          SoapEnvelope.VER11);
                  envp.dotNet = true;
                  envp.setOutputSoapObject(resultRequestSOAP);
                  AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(
                          URL);
                  try {
                      androidHttpTransport.call(SOAP_ACTION, envp);
                      SoapPrimitive resultsString = (SoapPrimitive)envp.getResponse();
                      System.out.println("resultsString"+resultsString);
                      return resultsString.toString();
  
                  } catch (Exception e) {
   System.out.println("---------------------------"+e.toString());
   Log.d("ppp", e.toString());
                      Toast.makeText(Soapclass.this,
                              "Check Network connectivety" + e.toString(),
                              Toast.LENGTH_LONG).show();
                      Log.v("WS Error-&gt;", e.toString());
                      return e.toString();
                  }*/
  
                   resultRequestSOAP = new SoapObject(NAMESPACE, METHOD_NAME);
                   pi1 = new PropertyInfo();
                   pi1.setName("crsCode");
                   pi1.setValue("HNH");//get the string that is to be sent to the web service
                   pi1.setType(String.class);
                   resultRequestSOAP.addProperty(pi1);
                  SoapSerializationEnvelope envp = new SoapSerializationEnvelope(
                          SoapEnvelope.VER11);
                  envp.dotNet = true;
                  envp.setOutputSoapObject(resultRequestSOAP);
                  AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(
                          URL);
                  try {
                      androidHttpTransport.call(SOAP_ACTION, envp);
                      SoapPrimitive resultsString = (SoapPrimitive)envp.getResponse();
                      System.out.println("resultsString"+resultsString);
                      return resultsString;
  
                  } catch (Exception e) {
   System.out.println("---------------------------"+e.toString());
   Log.d("ppp", e.toString());
                      Toast.makeText(Soapclass.this,
                              "Check Network connectivety" + e.toString(),
                              Toast.LENGTH_LONG).show();
                      Log.v("WS Error-&gt;", e.toString());
                      return e.toString();
                  }
  
  
              };
  
              protected void onPostExecute(String result) {
                  dialog.dismiss();
                  Toast.makeText(Soapclass.this,
                          "Check Network connectivety" + result,
                         Toast.LENGTH_LONG).show();
              };
          }.execute();
  
      }
  
      public boolean haveNetworkConnection() {
          boolean haveConnectedWifi = false;
          boolean haveConnectedMobile = false;
  
          ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
          NetworkInfo[] netInfo = cm.getAllNetworkInfo();
          for (NetworkInfo ni : netInfo) {
              if (ni.getTypeName().equalsIgnoreCase("WIFI"))
                  if (ni.isConnected())
                      haveConnectedWifi = true;
              if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
                  if (ni.isConnected())
                      haveConnectedMobile = true;
          }
          return haveConnectedWifi || haveConnectedMobile;
      }
  
  }
  </code></pre>
  
  <p>After change I am getting this object 
  I am getting this    SoapObject obj = (SoapObject)envp.getResponse(); 
                      System.out.println("resultsString"+obj);</p>
  
  <pre><code>resultsStringanyType{RID=201309201377618; alertDetailPopulated=true; alertsId=0; alertsSummary=anyType{}; destExpArrival=06:31; destSchArrival=06:30; destinationStation=anyType{crsCode=BKJ; stationName=Beckenham Junction; }; expArrival=06:19; expDepart=06:20; otherAlertPresent=false; platformNo=3; routeDetailPopulated=false; routeDetails=null; rsID=null; schArrival=06:19; schDepart=06:19; serviceAlertPresent=false; toc=SE; tocName=Southeastern; trainID=2M06; trainLastReportedAt=null; }
  </code></pre>
  
  <p>Now how to print RID or something else from this object.</p>