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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:06:18+00:00 2026-06-04T01:06:18+00:00

I’m starting to use webservices in Android and I followed this tutorial: Create Web

  • 0

I’m starting to use webservices in Android and I followed this tutorial: Create Web Service in Java Using Apache Axis2 and Eclipse to create and consume the webservice. This tutorial explain the client side application in Java but with some others tutorials I was able to consume the WS in Android like this:

package com.android.webservices;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

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

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

private String METHOD_NAME = "addTwoNumbers"; // our webservice method name
private String NAMESPACE = "http://sencide.com"; // Here package name in webservice with reverse order.
private String SOAP_ACTION = "http://sencide.com/addTwoNumbers"; // NAMESPACE + method name
private static final String URL = "http://192.168.1.214:8080/axis2/services/FirstWebService?wsdl"; // you must use ipaddress here, don’t use Hostname or localhost

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

    Button addButton = (Button) findViewById(R.id.button1);

    addButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            try
            {
                SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
                EditText num1 = (EditText) findViewById(R.id.editText1);
                EditText num2 = (EditText) findViewById(R.id.editText2);
                request.addProperty("firstNumber", Integer.valueOf(num1.getText().toString()));
                request.addProperty("secondNumber", Integer.valueOf(num2.getText().toString()));
                SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
//                  envelope.dotNet = true;
                    envelope.setOutputSoapObject(request);
                    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
                    androidHttpTransport.call(SOAP_ACTION,envelope);
                    Object result = envelope.getResponse();
                    System.out.println("Result : " + result.toString());
                    ((TextView) findViewById (R.id.textView4)).setText(result.toString());
                } catch (Exception E) {
                    E.printStackTrace();
                }
            }
        });

    }
}

But now I have some questions about consuming WS in Android:

  1. As I can see here, the kSOAP2 library is deprecated… Should I continue to use this library or I need another tool? If yes, which one?
  2. Is it possible to know the NAMESPACE, METHOD_NAME, SOAP_ACTION using only the WSDL of the service?
  3. Can I generate some code automatically using WSDL (like WSDL2Java tool that is used for Java applications)?
  4. At the addProperty(String name, Object value) method, can I used arbitrary name or it should follow a rule?

Thanks in advance!

  • 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-04T01:06:20+00:00Added an answer on June 4, 2026 at 1:06 am

    Apache Axis is for Java and do not work in Android platform. Ksoap2 library is an alternate for this and mostly used tool to consuming webservices in Android. For your questions:

    1 – Today [15.5.2012] i can see the last commit only 4 days ago in here

    2 – Yes it is possible. The namespace describes like as follow:

    <wsdl:definitions targetNamespace="http://tempuri.org/">
    

    And method(s) name(s) describes like as follow:

    <s:element name="YourMethodName">
    

    And SOAP action is genarally consist NAMESPACE + METHOD_NAME;

    3 – As I know, there is no well written project for now.

    4 – It should follow a rule that must be mach to WSDL’s attributes name and case sensitivity

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the

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.