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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:29:56+00:00 2026-06-15T17:29:56+00:00

im trying to self learn how to consume an aspx web service from android.

  • 0

im trying to self learn how to consume an aspx web service from android.

In this case im trying to pass an array of objects from a web service.

I would like to take a look at a sample [web method] that passes an array of objects.

and if possible a sample code of how the array passed by the web service is consumed by the android application. (the java code)

Any code posted would be highly appreciated.. 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-15T17:29:57+00:00Added an answer on June 15, 2026 at 5:29 pm

    You will have to use JSON to get array of objects in Android

    so Now, let me start to give step by step demo for parsing the same JSON resoponse:

    Step – 1:

    create a JSONObject with the received response string:

    JSONObject jsonObject = new JSONObject(strJSONResponse);

    Step – 2:

    Get the main object from the created json object by using getJSONObject() method:

    JSONObject object = jsonObject.getJSONObject("FirstObject");

    Step – 3:

    Now this FirstObject contains 2 strings namely “attr1″,”attr2″ and a object namely “sub”.
    So get 2 strings by using getString() method.

    String attr1 = object.getString("attr1");
    String attr2 = object.getString("attr2");

    and get a sub object by using the same getJSONObject() method as we have used above:

    JSONObject subObject = object.getJSONObject("sub");

    Step – 4:

    Now this “sub” sub-object contains 1 array namely “sub1″. So we can get this JSON array by using
    getJSONArray() method:

    JSONArray subArray = subObject.getJSONArray("sub1");

    Now, we just need to process this array same as simple string array:

    for(int i=0; i<subArray.length(); i++)
    {
    strParsedValue+="\n"+subArray.getJSONObject(i).getString("sub1_attr").toString();
    }

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

Sidebar

Related Questions

I'm trying to learn iOS from an entirely Android background. I would like to
I am trying to self-learn developing Web applications using Python as backend. Since I
I am trying to learn assembly my self, and I have been reading different
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
Trying to set up a self signed certificate, for our intranet's web services site.
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
I am trying to learn CorePlot. I found a code example from codejunkster that
I am trying to learn how to use threads with python. this is the
I'm trying to learn IronPython. I created an extremely simple class like this one:
I am trying to learn PyQt from rapid gui programming with python and qt

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.