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

  • Home
  • SEARCH
  • 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 8070263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:21:50+00:00 2026-06-05T13:21:50+00:00

Currently i am consuming web service from android by the method SOAP.Here i need

  • 0

Currently i am consuming web service from android by the method SOAP.Here i need to call the webservice and return the result on android/eclipse.ie.I need to get the input from edittext and return the appropriate value.

Please find my code for reference.

web method

public class GetName {
public String GetName(String a){
return(a);
}  }

NOTE: To avoid socket operation exceptions from main activity thread,i have written a separate classes and isolate soap related functions.

Caller.java

public class Caller  extends Thread 
{

public AlertDialog ad;
public CallSoap cs;
public int a;

public void run()
{
    try
    {
    cs=new CallSoap();  
    String resp=cs.Call(a);
    MySOAPCallActivity.rslt=resp;
    }catch(Exception ex)
    {
        MySOAPCallActivity.rslt=ex.toString();  
    }
    }    }

CallSOAP

public class CallSoap 
{
public final String SOAP_ACTION = "http://tempuri.org/GetName";

public  final String OPERATION_NAME = "GetName";

public  final String WSDL_TARGET_NAMESPACE = "http://tempuri.org/";

public  final String SOAP_ADDRESS = "http://122.248.240.105:234/Service1.asmx?WSDL";
public CallSoap()
{

}

public String Call(int a)
{

    SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
    PropertyInfo pi=new PropertyInfo();
    pi.setName("a");
    pi.setValue(a);
    pi.setType(Integer.class);
    request.addProperty(pi);

        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
        SoapEnvelope.VER11);
        envelope.dotNet = true;

        envelope.setOutputSoapObject(request);

        HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
        Object response=null;
        try

        {

            httpTransport.call(SOAP_ACTION, envelope);

            response = envelope.getResponse();
            }

            catch (Exception exception)

            {

                response=exception.toString();

            }


    return response.toString();
    }
 } 

MySOAPCallActivity

public class MySOAPCallActivity extends Activity 
    {
public static String rslt="";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button b1=(Button)findViewById(R.id.btn_getvalues);
    final  AlertDialog ad=new AlertDialog.Builder(this).create();

     b1.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {

        try
            {

            EditText ed1=(EditText)findViewById(R.id.et_1);

            String ed1str = ed1.getText().toString().trim();
            int a = Integer.parseInt(ed1str);

            rslt="START";           
            Caller c=new Caller();
            c.a=a;
            c.ad=ad;
            c.join();
            c.start();
            while(rslt=="START")
            {
                try
                {
                    Thread.sleep(5);

                }catch(Exception ex)
                {

                }
            }
           ad.setTitle("");
            ad.setMessage(rslt);

            }catch(Exception ex)
            {
                ad.setTitle("Error!");
                ad.setMessage(ex.toString());

            }
           ad.show();   
        }
    });
    }    }

OUTPUT SCREEN

enter image description here

Note: If I enter the vlaue “0005” it must return the String “Vivek” in browser.

But in my output screen it shown as “Name not found”.I wanna to return the appropriate value as per the users input.Please let me know how to mend my source.

Thanks for your precious time!..

  • 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-05T13:21:51+00:00Added an answer on June 5, 2026 at 1:21 pm

    Please use my experience. I think it will help you. I had lot of troubles while doing the same task. But finally i did the thing as given in the blog. http://www.insightforfuture.blogspot.com/search/label/Android

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

Sidebar

Related Questions

I am looking for some alternatives of consuming a SOAP web service in java.
I am consuming a Java Web Service as a WCF service from .NET. The
Currently I am responsible for a service: To make a Http Get call on
I have a Axis 1.4 (with Spring) web service client consuming a PHP web
I'm writing one of my first apps for consuming a web service in Objective
I have a web service that is protected by requiring the consuming third party
Following up on this post from back in September of 2008 regarding 'Consuming web
Here I am not creating a RESTful service indeed I have to call an
Currently playing about with KnockoutJS. Just trying to update an observable array from a
I am trying to consume the Exchange 2010 Web Service interface using JAX-WS. I'm

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.