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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:55:43+00:00 2026-06-15T23:55:43+00:00

I am trying to call an asmx web service from an Android app. Just

  • 0

I am trying to call an asmx web service from an Android app. Just literally started some Android development today. I’ve been following various solutions I have found on the net and on here and it seems it is more difficult than anticipated. I have tried various solutions and using KSoap2 seems to be the easiest way to implement this, well it would be if I could get it working.

I have the following code which works up until a point:

private class CallWebService extends AsyncTask<Void, Void, Void> {

    private static final String SOAP_ACTION = "http://tempuri.org/GetUser";
    private static final String METHOD_NAME = "GetUser";
    private static final String NAMESPACE = "http://tempuri.org/";
    private static final String URL = "http://160.10.1.79:59315/Service1.asmx";
    TextView tv;

    @Override
    protected Void doInBackground(Void... params) {
        tv=(TextView)findViewById(R.id.txtMessage);

        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);

            Object result = (Object)envelope.getResponse();

            tv.setText(result.toString());
        }
        catch (Exception e) {
            tv.setText(e.getMessage());
        }
        return null;
    }
}

It seems to hang at the line androidHttpTransport.call(SOAP_ACTION, envelope); Any ideas why? Is this the correct approach? Should I be looking in another direction?

  • 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-15T23:55:44+00:00Added an answer on June 15, 2026 at 11:55 pm

    Ok the solution for this was quite simple in the end. The web service was running under localhost, but would not work using localhost:59315. So I changed it to **MY IP**:59315. Still didn’t work. Using this question Accessing localhost:port from Android emulator I tried using 10.0.2.2:59315 and it worked. So thanks go to Akhil Jain in the other question.

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

Sidebar

Related Questions

Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I am trying to call the GetReportParameters method from the ReportingServices2005.asmx web service from
I am trying to call a Web Method of service from a Jquery Ajax
I am trying to call a SharePoint web service from Acrobat JavaScript, and I
I am trying to call a web service from a BizTalk (2006) orchestration. Having
I'm trying to parse JSON result from an Ajax call to .NET web service
I have created simple .NET Web Service (ASMX) that I call from my .NET
I'm trying to use the official jQuery autocomplete plugin with an ASMX web service
I'm able to call a 3rd party vendor's web service from a Windows form
I am trying to figure out the best way to call a web service

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.