title: Error connecting Android App to ASP .NET Web Service using ksoap2
body: <p>I am trying to connect my App to a Web Service that I created in <strong>ASP</strong> and is currently running on <code>localhost</code>. The App is trying to access the <code>Coordonate</code> method that takes in 3 integers. </p>
  
  <p>I have provided the code and the <strong>LogCat</strong>. I have to mention that I'm new to web services. </p>
  
  <p>Any help will be greatly appreciated! Cheers!</p>
  
  <p><strong>Code:</strong> </p>
  
  <pre><code>package Dan.Denver.Nuggets.googleMaps;
  
  import android.app.Activity;
  import android.app.AlertDialog;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.SeekBar;
  import android.widget.Toast;
  import android.widget.SeekBar.OnSeekBarChangeListener;
  import android.widget.TextView;
  
  import org.ksoap2.SoapEnvelope;
  import org.ksoap2.serialization.SoapObject;
  import org.ksoap2.serialization.SoapPrimitive;
  import org.ksoap2.serialization.SoapSerializationEnvelope;
  import org.ksoap2.transport.HttpTransportSE;
  
  public class SlideBar extends Activity
  {
  SeekBar seekBar;
  TextView textView;
  Button sendButton;
  
  private static final String SOAP_ACTION = "http://tempuri.org/Coordonate";
  private static final String METHOD_NAME = "Coordonate";
  private static final String NAMESPACE = "http://tempuri.org/";
  private static final String URL = "http://localhost:49934/Service1.asmx";
  
  SoapObject request;
  SoapSerializationEnvelope soapEnvelope;
  HttpTransportSE transport;
  SoapPrimitive rezultat;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.slidebar);
      textView = (TextView)findViewById(R.id.textView); 
      sendButton = (Button)findViewById(R.id.bSB);
  
      seekBar = (SeekBar)findViewById(R.id.sbSB);
      seekBar.setMax(100);
      seekBar.setProgress(1);
  
      seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() 
      {   
          public void onStopTrackingTouch(SeekBar seekBar)
          {
              // TODO Auto-generated method stub
          }
  
          public void onStartTrackingTouch(SeekBar seekBar)
          {
              // TODO Auto-generated method stub
          }
  
          public void onProgressChanged(SeekBar seekBar, int progress,
                  boolean fromUser) 
          {
              textView.setText(String.valueOf(progress + "%"));
  //              if(progress &gt;= 25 &amp;&amp; progress &lt; 50)
  //                  textView.setTextColor(R.color.Yellow);
  //              else if(progress &gt;= 50 &amp;&amp; progress &lt; 75)
  //                  textView.setTextColor(R.color.Orange);
  //              else if(progress &gt;= 75 &amp;&amp; progress &lt;= 100)
  //                  textView.setTextColor(R.color.Red);
  //              else 
  //                  textView.setTextColor(R.color.Green);   
          }
      });
  
      sendButton.setOnClickListener(new View.OnClickListener() 
      {   
          public void onClick(View v) 
          {
              // TODO Auto-generated method stub
              //Toast.makeText(getBaseContext(), "Drumul este congestionat in proportie de "+textView.getText().toString(), Toast.LENGTH_LONG).show();
              request = new SoapObject(NAMESPACE, METHOD_NAME);
              request.addProperty("latitudine", Main.latitudine);
              request.addProperty("longitudine", Main.longitudine);
              request.addProperty("procentTrafic", seekBar.getProgress());
  
              soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
              soapEnvelope.dotNet = true;
              soapEnvelope.setOutputSoapObject(request);
  
              transport = new HttpTransportSE(URL);
              try
              {
                  transport.call(SOAP_ACTION, soapEnvelope);
                  rezultat = (SoapPrimitive)soapEnvelope.getResponse();
                  Toast.makeText(getBaseContext(), rezultat.toString(), Toast.LENGTH_LONG).show();
              }
              catch(Exception e)
              {
                  e.printStackTrace();
              }           
          }
      });
  }
  }
  </code></pre>
  
  <p><strong>LogCat:</strong> </p>
  
  <pre><code>07-01 17:11:56.790: E/AndroidRuntime(1029): FATAL EXCEPTION: main
  07-01 17:11:56.790: E/AndroidRuntime(1029): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at Dan.Denver.Nuggets.googleMaps.SlideBar$2.onClick(SlideBar.java:80)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at android.view.View.performClick(View.java:2408)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at android.view.View$PerformClick.run(View.java:8816)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at android.os.Handler.handleCallback(Handler.java:587)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at android.os.Handler.dispatchMessage(Handler.java:92)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at android.os.Looper.loop(Looper.java:123)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at java.lang.reflect.Method.invoke(Method.java:521)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  07-01 17:11:56.790: E/AndroidRuntime(1029):     at dalvik.system.NativeStart.main(Native Method)
  07-01 17:12:00.229: I/Process(1029): Sending signal. PID: 1029 SIG: 9
  </code></pre>