Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8855821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:13:21+00:00 2026-06-14T14:13:21+00:00

i have wrote a program in android for webservice using soap. but iam not

  • 0

i have wrote a program in android for webservice using soap. but iam not aware of asynctask. Can some one Correct the program flow. I need to send a integer value and get converted value thru webservice

   package com.example.webservice;

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.HttpTransportSE;

import com.example.webservice.R.string;

import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class WebService extends Activity {
       private final String NAMESPACE = "http://tempuri.org/";
       private final String URL = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl";
       private final String SOAP_ACTION = "http://tempuri.org/CelsiusToFahrenheit";
       private final String METHOD_NAME = "CelsiusToFahrenheit";
    String celsius="";
       Button b;
    TextView tv;
    EditText et;
    String res;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_service);
        et=(EditText)findViewById(R.id.editText1);
        tv=(TextView)findViewById(R.id.Result);
        b=(Button)findViewById(R.id.button1);
        b.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
            //String result=getFarenheit(et.getText().toString());
            //tv.setText(result+"°F");
            new service().execute();
            }
        });
    }
    private class service extends AsyncTask<Void, Void, String>{

        @Override
        protected String doInBackground(Void... arg0) {

            SoapObject request= new SoapObject(NAMESPACE, METHOD_NAME);
            PropertyInfo celsuiusPI= new PropertyInfo();
            celsuiusPI.setName("Celsius");
            celsuiusPI.setValue(celsius);
            celsuiusPI.setType(string.class);
            request.addProperty(celsuiusPI);
            SoapSerializationEnvelope envelope=new SoapSerializationEnvelope (SoapEnvelope.VER11);
            envelope.dotNet=true;
            envelope.setOutputSoapObject(request);
            HttpTransportSE androidHttpTransport=new HttpTransportSE(URL);
            try{
                androidHttpTransport.call(SOAP_ACTION, envelope);
                SoapPrimitive response=(SoapPrimitive)envelope.getResponse();
                Log.i("WebService output", response.toString());
                res= response.toString();

            }
            catch(Exception e){
                e.printStackTrace();
            }

            return res;

        }
         protected void onPostExecute(String h){
             String result=h;
                tv.setText(result+"°F");

    }


}
}

Trace

11-15 18:38:08.045: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:08.065: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:08.065: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:08.515: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:08.515: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:08.546: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:08.546: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.130: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.130: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.167: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.167: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.685: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.685: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.736: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:09.736: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.235: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.235: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.255: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.255: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.801: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.801: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.825: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
11-15 18:38:10.825: W/Trace(823): Unexpected value from nativeGetEnabledTags: 0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:13:22+00:00Added an answer on June 14, 2026 at 2:13 pm

    Try this

    try {
            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                    SoapEnvelope.VER11);
            request.addProperty("XMLMarks", pXmlString);
            envelope.dotNet = true;
            envelope.implicitTypes = true;
            envelope.enc = SoapSerializationEnvelope.ENC2003;
            envelope.xsd = SoapEnvelope.XSD;
            envelope.xsi = SoapEnvelope.XSI;
            envelope.setOutputSoapObject(request);
            envelope.setAddAdornments(false);
    
            HttpTransportSE ht = new HttpTransportSE(URL);
            ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            ht.debug = true;
            ht.call(SOAP_ACTION, envelope);
    
    
    
            final SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
            // final SoapObject response = (SoapObject)envelope.getResponse();
            Toast.makeText(this,response.toString(),Toast.LENGTH_LONG).show();
            String str = response.toString();
            strcheck = str;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program using android and I would like a few tips on
I made a program on Android. But this is my thesis and I have
In my Android program, I have some code that downloads a file. This works
I've just started android learning recently, and I'm trying to write one program, but
I have wrote the code below which was taken from Java How to program
I have a program I wrote in Windows with this piece of code that
I wrote a small test program for flipperview. I have 3 views. I call
Background: I am using Eclipse to develop an Android app. I have an xml
I wrote a basic python program to parse android's resources.arsc. it prints out all
I have a mono android project. I can use monodevelop to build the apk

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.