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 8073465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:20:54+00:00 2026-06-05T14:20:54+00:00

By SOAP method i want to consume a web service from android/eclipse.But the way

  • 0

By SOAP method i want to consume a web service from android/eclipse.But the way of consuming web service is,i have to give an input and it should have to return the proper values from the web service.How to achieve it?

web method

public class FahrenheitToCelsius {
public double FahrenheitToCelsius(double Fahrenheit)
{
    return ((Fahrenheit - 32) * 5) / 9;
}
}

.java class

public class Demo_webserviceActivity extends Activity
{
    /** Called when the activity is first created. */

       private static String NAMESPACE = "http://tempuri.org/";
       private static String METHOD_NAME = "FahrenheitToCelsius";
       private static String SOAP_ACTION = "http://tempuri.org/FahrenheitToCelsius";
       private static String URL = "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL";

       Button btnFar;
       EditText txtFar,txtCel;

   @Override
   public void onCreate(Bundle savedInstanceState)
   {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);

       btnFar = (Button)findViewById(R.id.btnFar);

       txtFar = (EditText)findViewById(R.id.txtFar);
       txtCel = (EditText)findViewById(R.id.txtCel);

       btnFar.setOnClickListener(new View.OnClickListener()
       {

       public void onClick(View v)
       {
         //Initialize soap request + add parameters
         SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);       

        //Use this to add parameters
        request.addProperty("Fahrenheit",txtFar.getText().toString());

        //Declare the version of the SOAP request
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        envelope.setOutputSoapObject(request);
        envelope.dotNet = true;

        try 
        {
            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

             //this is the actual part that will call the webservice
             androidHttpTransport.call(SOAP_ACTION, envelope);

             // Get the SoapResult from the envelope body.
             SoapObject result = (SoapObject)envelope.bodyIn;

             if(result != null)
             {
              //Get the first property and change the label text
               txtCel.setText(result.getProperty(0).toString());
             }
             else
             {
               Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_LONG).show();
             }
        }
        catch (Exception e) 
         {
           e.printStackTrace();
           }
         }
       });
    }
}
  • 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-05T14:20:56+00:00Added an answer on June 5, 2026 at 2:20 pm

    Remove ?WSDL from your URL and try

    private static String URL =
    “http://www.w3schools.com/webservices/tempconvert.asmx”;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have an internal SOAP Web service that is being called from an external
I have a Web Service accessible via SOAP. Let's assume it provides a method
I want to retrieve an arrayList from the web service in my android activity.
Is there any way to consume a SOAP based Spring web service without generating
i am self-leaner to android.Right now i am consuming web service in android eclipse
I'm interfacing to a WCF web service that exposes its method using SOAP, using
I have a SOAP based web service running using Apache CXF. I have WS-Addressing
I am developing a SOAP web service with CXF 2.3.3. I want to throw
I want send an image from my App to web service, to do it,
im Consuming a Soap webservice and im calling a method , i want to

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.