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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:05:50+00:00 2026-05-25T11:05:50+00:00

hi m using a web service. i m doing for a POC. here is

  • 0

hi m using a web service.
i m doing for a POC.
here is my activity class:
i m using ksoap2.

package ab.tina;

import java.io.InputStream;
import java.net.URI;

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

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class TinaWebActivity extends Activity {

    private TextView txtview;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        txtview=(TextView)findViewById(R.id.textView1);
        try {
            SoapObject Request = new SoapObject("http://www.webserviceX.NET/", "GetQuote");
            Request.addProperty("symbol", "MFST");

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


            HttpTransportSE androidHttpTransport = new HttpTransportSE("http://www.webservicex.net/stockquote.asmx");


            Log.e("tag1","err1");
            androidHttpTransport.call("http://www.webserviceX.NET/GetQuote", envelope);
            Log.e("tag2","err2");

            SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
            Log.e("tag3","err3");
           //String str=(String)response.getProperty(1);
            txtview.setText(response.toString());
            //txtview.setText(response.toString());
            Log.e("tag4","err4");
        }
        catch (Exception e) {
               Log.e("tag5","err5");
            txtview.setText(e.getMessage());
        }

    }
}

i m getting result like this:

<string xmlns="http://www.webserviceX.NET/">
<StockQuotes><Stock><Symbol>MFST</Symbol><Last>0.00</Last><Date>N/A</Date><Time>N/A</Time><Change>N/A</Change><Open>N/A</Open><High>N/A</High><Low>N/A</Low><Volume>N/A</Volume><MktCap>N/A</MktCap><PreviousClose>N/A</PreviousClose><PercentageChange>N/A</PercentageChange><AnnRange>N/A - N/A</AnnRange><Earns>N/A</Earns><P-E>N/A</P-E><Name>MFST</Name></Stock></StockQuotes>
</string>

please tell me how can i parse it . which class i will require and wht method should i use?

  • 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-25T11:05:51+00:00Added an answer on May 25, 2026 at 11:05 am

    well if you want to get info from that you need to search inside of soapobject each node is a soapobject.

    in your case you do something like:

     resultData = (SoapObject)resultData.resultData.getProperty("StockQuotes");
    //now resultData have all node of stockQuotes
     resultData = (SoapObject)resultData.resultData.getProperty("Stock");
    //now resultdata have stock 
    
    //now to parse string saftelly go to ksoap 2 android project download last version 
    String symbol = resulresultData.getPropertySafelyAsString("Symbol", "NO DATA");
    //or
    String symbol = resulresultData.getPropertySafelyAsString("Symbol");
    
    //and so on for other XML 
    

    have fun happy coding

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

Sidebar

Related Questions

I'm using Web Services Enhancements 3.0 to call a web-service from an ASP.NET application
I want to invoke an ASP.NET web service via an http POST request using
I am using NuSOAP to try to consume a Web Service built in Java.
Ok, I got an asp.net web service using WSE2. It runs on a xp
Am trying to invoke a public web-service using a java client but am getting
Using a web service is often an excellent architectural approach. And, with the advent
I'm using a web service that returns a dataset. in this dataset there are
I'm using a web service and every time I change something on the dataset,
we are using a web service for a web site to communicate with an
I'm using a web service which returns a list of products. I created a

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.