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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:34:42+00:00 2026-05-29T07:34:42+00:00

I would like to learn how to use webSservices with Android. At the moment,

  • 0

I would like to learn how to use webSservices with Android.
At the moment, I have a server with the wsdl file and I am able to call a desired Webservice from.

My problem is that I got the response from the server and I would like to extract some informations which are interessant for me, for example the user id or something like that.

Here is my code:

public class TestBookSoapActivity extends Activity {

private static final String SOAP_ACTION = "JournalArticles";
private static final String METHOD_NAME = "JournalArticles";
private static final String NAMESPACE = "http://api.mdpi.com/ws/";
private static final String URL = "http://api.mdpi.com/ws/server.php";


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    executeAppelSOAP();  
}

private void executeAppelSOAP() {
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    request.addProperty("JournalID", 1);
    request.addProperty("Volume", 12);
    request.addProperty("Issue", 1);

    SoapSerializationEnvelope enveloppe = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    enveloppe.setOutputSoapObject(request);
    AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);             
    try {
        androidHttpTransport.call(SOAP_ACTION, enveloppe);
        Object resultat = enveloppe.getResponse();
        System.out.println(" Journal Articles= " + resultat.toString());
    } catch(Exception e) {
        e.printStackTrace();
        System.out.println("Problem");
    }
}

Could I use the enveloppe.parse() method and if so, how?

Thank you.

  • 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-29T07:34:43+00:00Added an answer on May 29, 2026 at 7:34 am

    There are two steps you should take:

    1. Get the correct XML value
    2. Parse XML

    About 1…
    I prefer HttpTransportSE so instead of:

    AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);
    

    use:

    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    

    Then instead of:

    Object resultat = enveloppe.getResponse();    
    

    use:

    SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
    String xml = response.toString();
    

    You can also check with the debugger how response looks like. More details you can read in answers to this question.

    About 2…
    You can use any XML parser. I prefer SAX for performance reasons. Here is an Android example: how to parse XML in Android

    Regards,
    Dragan

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

Sidebar

Related Questions

I would like to learn how to use NUnit. I learn best by reading
I would like to learn how to use binding functions. Here is the idea:
I would like to learn how I can use nested template tags where the
I would like to learn from and possibly use the section serializer that Jeff
I would like to learn how to write the simplest server/client C++ command line
I would like to learn how to use TFS2010, but I can't find any
I would like to learn how to use jsonp with python. I googled around
I would like to learn to use Oracle some, just for the sake of
I have several low quality pdfs. I would like to use OCR -- to
I would like to learn more about C++0x. What are some good references 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.