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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:33:57+00:00 2026-05-28T01:33:57+00:00

Am very new to Android apps development. In my new Android app i want

  • 0

Am very new to Android apps development. In my new Android app i want to show some data from webservice. This means i have a SOAP message, i need to parse the data from SOAP response. In iPhone app i knew very well to parse SOAP message response but, in android i don’t know how to do this? I searched lot in Google and get some ideas. But, am very confusing on this. Can anyone please suggest any easiest way to understand SOAP send request/receive response and parse(XML format) the response in SAXParser in Android? I has installed ksoap2-android-assembly-2.6.0-jar-with-dependencies.jarin my project. Here i found some sample code, i post here,

import java.io.*;
import org.ksoap2.SoapEnvelope;
import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParserException;


public class ParsingSteps 
{
  public static void main(String[] args) 
   {
     try{
       // String msg="<hello>World!</hello>";
        String msg = "<SOAP-ENV:Envelope " + "xmlns:SOAP-ENV=\"http://
www.w3.org/2001/12/soap-envelope\" " + "xmlns:xsi=\"http://www.w3.org/
 2001/XMLSchema-instance <http://www.w3.org/%0A2001/XMLSchema-instance>\""
 +"xmlns:xsd=\"http://www.w3.org/2001/
 XMLSchema\"& gt;" +
         "<SOAP-ENV:Body>" +
         "<result>" +
         "<message xsi:type=\"xsd:string\">Hello World</message>" +
        "</result>" +
        "</SOAP-ENV:Body>" +
        "</SOAP-ENV:Envelope>";

      //  byte[] in= msg.getBytes();

        KXmlParser parser=new KXmlParser();
       parser.setInput(new StringReader(msg));
       SoapEnvelope soapenvelope= new SoapEnvelope
(SoapEnvelope.VER12);
        //soapenvelope.parse(parser);
        soapenvelope.parseBody(parser);

          }
       catch (IOException e) {
               System.out.println("Error reading URI: " + e.getMessage ());
       } catch (XmlPullParserException e) {
              System.out.println("Error in parsing: " + e.getMessage ());
       }
      //  String result=parser.getName();
       //System.out.println(result);
    }
 }

Is this correct code. Please give any suggestion on my question. Please help me on this. 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-05-28T01:33:58+00:00Added an answer on May 28, 2026 at 1:33 am


    Google for Ksoap2 tutorial u will get a lot of them . Here is sample code for sending request to web service .

    public class WebServicePoc extends Activity{
    private static final String SOAP_ACTION = "http://tempuri.org/Arnoid";
    private static final String METHOD_NAME = "Arnoid";
    private static final String NAMESPACE = "http://tempuri.org/";
    private static final String URL = "http://ipaddress:port/UserAuthenticationInterfacer.asmx";
    EditText editText;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        HashMap<String, String> a=new HashMap<String, String>();
        try {
    
            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
            request.addProperty("FOSID", "1994");
            request.addProperty("IMEINumber", "");
            request.addProperty("SIMCardNo", "");
            request.addProperty("ApplicationName", "App");
            request.addProperty("CurrentVersion", "1.0.0.0");
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.dotNet=true;
            envelope.setOutputSoapObject(request);
            AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
            androidHttpTransport.call(SOAP_ACTION, envelope);
            SoapObject result = (SoapObject)envelope.getResponse();
            editText=(EditText)findViewById(R.id.text1);
            editText.setText(result.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    

    And for xml pls check tutorial for xml parsers,use SAX only, as STAX is not supported in android . For sending xml request u can send xml as string and then decode on sever side .

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

Sidebar

Related Questions

I am very new to android development.... i have created an app and want
Hi I'm very new to android development, and want to create an app with
I am really very new on android development. I have made 2-3 apps ,
I have been slowing learning and building my first android app. I'm VERY new
I want to store some data from structures like this: class Project { ChildA
I am very new to Android application development. I successfully added some backgrounds to
I am very new to Android development, so I appologise in advance if this
I'm very new on Android development. I want to create and start an activity
I am very new to Android programming, and I have read everywhere and I
ok so im very new to android development and fairly new to java and

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.