title: How to get a data from magento frame work using SOAP in android?
body: <p>I want to get a data from magento frame work using SOAP in android.
  refer this url: <a href="http://inchoo.net/dev-talk/android-development/magento-v2-api-soap-android/" rel="nofollow">http://inchoo.net/dev-talk/android-development/magento-v2-api-soap-android/</a></p>
  
  <p>but i unable to get a session id</p>
  
  <p>This is my code </p>
  
  <pre><code> import java.io.IOException;
   import org.ksoap2.SoapEnvelope;
   import org.ksoap2.serialization.SoapObject;
   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;
  
  public class SoapTestActivity extends Activity {
           /** Called when the activity is first created. */
  
        private static final String NAMESPACE = "urn:Magento";
        private static final String Method_Name="login";
        private static final String URL ="http://localhost/onlinesales/api/v2_soap/?wsdl=1";
        private static final String SOAP_ACTION ="urn:Magento/login";
  
   @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      try {
        SoapObject request = new SoapObject(NAMESPACE,Method_Name);
  
          request.addProperty("username", "test");
          request.addProperty("apiKey", "test123");
          SoapSerializationEnvelope envelopes = new SoapSerializationEnvelope(
                  SoapEnvelope.VER11);
  
          envelopes.dotNet = false;
          envelopes.xsd = SoapSerializationEnvelope.XSD;
          envelopes.enc = SoapSerializationEnvelope.ENC;
  
  
         envelopes.setOutputSoapObject(request);
  
          AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
          androidHttpTransport.debug =true;
          androidHttpTransport.call(SOAP_ACTION, envelopes);//Getting the Exception here
          Object result = envelopes.getResponse();
  
          Log.d("sessionId", result.toString());
  
          //making call to get list of customers
  
          String sessionId = result.toString();
  
          request = new SoapObject(NAMESPACE,"customerCustomerList");
          request.addProperty("sessionId",sessionId );
  
          envelopes.setOutputSoapObject(request);
          androidHttpTransport.call(SOAP_ACTION, envelopes);
  
          result = envelopes.getResponse();
  
          Log.d("Customer List", result.toString());
  
      } catch (Exception e) {
          e.printStackTrace();
      }
   }
   } 
  </code></pre>
  
  <p>and i got error like this</p>
  
  <pre><code>02-12 14:05:33.282: W/ResourceType(455): Attempt to retrieve bag 0x7f060000 which is invalid or in a cycle.
  02-12 14:05:35.173: W/System.err(455): org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@40527be0) 
  02-12 14:05:35.173: W/System.err(455):  at org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
  02-12 14:05:35.173: W/System.err(455):  at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1413)
  02-12 14:05:35.183: W/System.err(455):  at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:126)
  02-12 14:05:35.183: W/System.err(455):  at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
  02-12 14:05:35.183: W/System.err(455):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
  02-12 14:05:35.183: W/System.err(455):  at com.bugtreat.megento.SoapTestActivity.onCreate(SoapTestActivity.java:43)
  02-12 14:05:35.183: W/System.err(455):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  02-12 14:05:35.183: W/System.err(455):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
  02-12 14:05:35.192: W/System.err(455):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
  02-12 14:05:35.192: W/System.err(455):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  02-12 14:05:35.192: W/System.err(455):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
  02-12 14:05:35.192: W/System.err(455):  at android.os.Handler.dispatchMessage(Handler.java:99)
  02-12 14:05:35.192: W/System.err(455):  at android.os.Looper.loop(Looper.java:123)
  02-12 14:05:35.204: W/System.err(455):  at android.app.ActivityThread.main(ActivityThread.java:3683)
  02-12 14:05:35.204: W/System.err(455):  at java.lang.reflect.Method.invokeNative(Native Method)
  02-12 14:05:35.204: W/System.err(455):  at java.lang.reflect.Method.invoke(Method.java:507)
  02-12 14:05:35.212: W/System.err(455):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  02-12 14:05:35.212: W/System.err(455):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  02-12 14:05:35.212: W/System.err(455):  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Please help me...</p>