generates the code for web service that automatically executes
asynchronous anonymous methods on the UI thread and as well as it does
all SOAP handling and it is light weight.
On Jan 13, 5:34 pm, kandroid <mdrezaulho...@gmail.com> wrote:
> Hi
> I am a new bee to the android world. trying to call a .netwebservice
> from my android app with no luck.
>
> This is my code:
> -------------------------------------------------------
> import android.app.Activity;
> import android.os.Bundle;
> import org.ksoap2.SoapEnvelope;
> import org.ksoap2.serialization.SoapObject;
> import org.ksoap2.serialization.SoapSerializationEnvelope;
> import org.ksoap2.transport.HttpTransportSE;
> import android.widget.TextView;
>
> public class callWebservice extends Activity {
> private static final String METHOD_NAME = "HelloWorld";
>
> private static final String NAMESPACE = "http://tempuri.org/";
> private static final String URL = "http://service.screwedmind.com/
> LocalBusiness.asmx";
> private static final String SOAP_ACTION = null;
> TextView tv;
>
> /** Called when the activity is first created. */
> @Override
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.main);
> tv=(TextView)findViewById(R.id.text1);
> call();
> }
> public void call()
> {
> try {
>
> SoapObject request = new SoapObject(NAMESPACE,
> METHOD_NAME);
>
> SoapSerializationEnvelope envelope = new
> SoapSerializationEnvelope(SoapEnvelope.VER11);
> envelope.dotNet=true;
> envelope.setOutputSoapObject(request);
>
> HttpTransportSE androidHttpTransport = new
> HttpTransportSE(URL);
> androidHttpTransport.call(SOAP_ACTION, envelope);
>
> String result=(String)envelope.getResponse();
>
> tv.setText(result);
> }
> catch (Exception e) {
> tv.setText("oooopppss error occured...");
> }
> }}
>
> --------------------------------------------------
> after running the code, i see only my error message. which is
> "oooopppss error occured..."
>
> can anybody guide me what i am doing wrong.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment