android to consume a .net web service

I am using a few links to create a web service in my android....they make it sound like copy and paste code..but when I did that..I am getting all these errors...like:

1)Soap object cannot be resolved
2)envelope.setOutputSoapObject(request); >>>>UNDEFINED
3)  Object result = (Object)envelope.getResponse(); >>>>GETRESPONSE IS UNDEFINED
4)    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); >>>>CANNOT BE RESOLVED TO A VARAIBLE....

also how can I consume this into a dataset?
import org.ksoap2.serialization.SoapObject; 
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE; 
import android.app.*; 
import android.os.*; 
import android.widget.TextView; 

import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;




 public class COG_APP_12_10_2011Activity extends Activity {
    
	 
	 /** Called when the activity is first created. */ 
	    private static final String SOAP_ACTION = "http://tempuri.org/HelloWorld"; 	 
	    private static final String METHOD_NAME = "HelloWorld"; 	 
	    private static final String NAMESPACE = "http://tempuri.org/"; 
	    private static final String URL = "http://webxxxxx.com/COG_WS_AxxxxxxxxV3D9KLL.asmx"; 
	    TextView tv; 
	 
	    // ------------------------------------------------------------------
	    @Override 
	    public void onCreate(Bundle savedInstanceState) { 
	       super.onCreate(savedInstanceState); 
	        setContentView(R.layout.main); 
	       tv=(TextView)findViewById(R.id.text1); 
	       // CONSUME .NET WEB SERVICE
	        call(); 
	        // SETUP SPLASH PAGE....
	        setupSplash();
	 
	   } 
	    //--------------------------------------------------------------------
	 
	    public void call() 
	    { 
	        try { 
	 
	            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
	 
	          //  request.addProperty("passonString", "Rajapandian"); 
	 
	            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
	            envelope.dotNet=true; 
	            envelope.setOutputSoapObject(request); 
	 
	            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
	            androidHttpTransport.call(SOAP_ACTION, envelope); 
	 
	            Object result = (Object)envelope.getResponse(); 
	 
	            tv.setText(result.toString()); 
	        } catch (Exception e) { 
	            tv.setText(e.getMessage()); 
	            } 
	    }

Open in new window

LVL 10
GlobaLevelProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GlobaLevelProgrammerAuthor Commented:
Any ideas...can I put the web service code in the same .java file as main activity, it seems to be forcing me into creating new java files...
0
DarrenSenior Software EngineerCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GlobaLevelProgrammerAuthor Commented:
Curious if there is any existing code...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Android

From novice to tech pro — start learning today.