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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:06:08+00:00 2026-06-17T16:06:08+00:00

I am new to android and I am trying one example of web service.

  • 0

I am new to android and I am trying one example of web service.
I have used ksoap2 lib.
I followed one video and typed following code:

package example.web;

import android.R.anim;
import android.app.Activity;
import android.os.Bundle;
import org.ksoap2.*;
import org.ksoap2.serialization.*;
import org.ksoap2.transport.*;
import android.widget.TextView;

public class First extends Activity {
/** Called when the activity is first created. */
    TextView tv;
    private static final String                SOAP_ACTION="http://tempuri.org/CelsiusToFahrenheit";
    private static final String METHOD_NAME="CelsiusToFahrenheit";
    private static final String NAMESPACE="http://tempuri.org/";
    private static final String URL="http://www.w3schools.com/webservices/tempconvert.asmx";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        tv = (TextView) findViewById(R.id.textView1);

        // creating the soap request and all its paramaters
        SoapObject request= new SoapObject(NAMESPACE, METHOD_NAME);
        request.addProperty("Celsius","32");// hardcoding some random value
        //we can also take in a value in a var and pass it there


        //set soap envelope,set to dotnet and set output
        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        soapEnvelope.dotNet=true;
        soapEnvelope.setOutputSoapObject(request);

        HttpTransportSE obj = new HttpTransportSE(URL);
        //to make call to server
        try {
            obj.call(SOAP_ACTION,soapEnvelope);// in out parameter
        SoapPrimitive resultString=(SoapPrimitive)SoapEnvelope.getResponse();
        tv.setText("Status : " + resultString);
        }
        catch(Exception e) {
        e.printStackTrace();
        }
    }
}

SoapPrimitive resultString=(SoapPrimitive)SoapEnvelope.getResponse();

At above line I am gettin error on getResponse();
Please someone help me.

  • 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-17T16:06:09+00:00Added an answer on June 17, 2026 at 4:06 pm

    Try to change your SoapEnvelope into soapEnvelope and get the result inside SoapObjectinstead of SoapPrimitive

    try
    {
        obj.call(SOAP_ACTION,soapEnvelope);// in out parameter
        SoapObject resultString = (SoapObject) soapEnvelope.getResponse();
        tv.setText("Status : " + resultString);
    }
    catch (Exception e) 
    {
        SoapObject resultString = (SoapObject)soapEnvelope.bodyIn; 
    }
    

    Hope it helps you out!!

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

Sidebar

Related Questions

New with Android. Sorry! I'm trying to create the following... Wait for Timer to
i'm new to android. I'm just trying to make one simple search functionality for
I am a new android programmer and i am trying to create the following
Hello StackOverflow Users, I am new to android and trying to develop a game
I am new to android..Actually iam trying to increase the RAM Memory of android
I'm trying to record audio this.recorder = new android.media.MediaRecorder(); this.recorder.setAudioSource(android.media.MediaRecorder.AudioSource.MIC); this.recorder.setOutputFormat(android.media.MediaRecorder.OutputFormat.DEFAULT); this.recorder.setAudioEncoder(android.media.MediaRecorder.AudioEncoder.DEFAULT); this.recorder.setOutputFile(pruebaAudioRecorder.mp4); **this.recorder.prepare();**
im new to android and I've been trying to figure out how to display
i am new to android programming and i am trying to develop an app
I am new to android programming and i am trying to develop this app
I am new to android and I am trying to load huge data which

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.