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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:01:10+00:00 2026-06-03T22:01:10+00:00

My problem is this: I’ve got a SoapObject. I’ve successfully iterated through it to

  • 0

My problem is this: I’ve got a SoapObject. I’ve successfully iterated through it to find the different nested element and saved them in an object(I think?)…

My code is this:

        if(sResult != null)
        {
            SoapObject soapresults = (SoapObject)sResult.getProperty(0);

            int count = soapresults.getPropertyCount();

            ChildStatus[] children = new ChildStatus[count];

            for (int i = 0; i < count; i++)
            {
                SoapObject kid = (SoapObject)soapresults.getProperty(i);
                ChildStatus childStatus = new ChildStatus();
                SoapObject value = (SoapObject)kid.getProperty("Value");
                SoapObject info = (SoapObject)value.getProperty("Info");

                childStatus.CheckOutPlanned = value.getPropertyAsString("CheckOutPlannedTime");
                childStatus.CurrentStatus = value.getPropertyAsString("CurrentStatus");
                childStatus.FullName = info.getPropertyAsString("FullName");
                childStatus.ID = info.getPropertyAsString("Id");
                childStatus.KindergardenID = info.getPropertyAsString("KindergardenId");
                childStatus.URL = info.getPropertyAsString("ThumbnailUrl");

                String pickUpBy = value.getPropertyAsString("PickUpBy");


                if(pickUpBy.equalsIgnoreCase("anyType{}"))
                {
                    System.out.println("Ja");
                    pickUpBy = "none";
                } else if(pickUpBy.equalsIgnoreCase("En anden forælder"))
                {
                    childStatus.PickUpWithKidID = value.getPropertyAsString("PickUpWithKidId");
                    childStatus.PickUpWithKidName = value.getPropertyAsString("PickUpWithKidName");
                }

                childStatus.PickUpBy = value.getPropertyAsString("PickUpBy");

                children[i] = childStatus;
            }

            System.out.println("Size: " + children.length);

and my Object is this:

public class ChildStatus implements KvmSerializable 
{
    public String CheckOutPlanned;
    public String CurrentStatus;
    public String FullName;
    public String ID;
    public String KindergardenID;
    public String URL;
    public String PickUpBy;
    public String PickUpWithKidID;
    public String PickUpWithKidName;

    public ChildStatus(){}

    public ChildStatus(String checkOutPlanned, String currentStatus, String fullName, String id, String kindergardenID, String url, String pickUpBy, String pickUpWithKidID, String pickUpWithKidName)
    {
        CheckOutPlanned = checkOutPlanned;
        CurrentStatus = currentStatus;
        FullName = fullName;
        ID = id;
        KindergardenID = kindergardenID;
        URL = url;
        PickUpBy = pickUpBy;
        PickUpWithKidID = pickUpWithKidID;
        PickUpWithKidName = pickUpWithKidName;
    }

    public Object getProperty(int arg0) {
        // TODO Auto-generated method stub
        switch(arg0)
        {
        case 0:
            return CheckOutPlanned;
        case 1:
            return CurrentStatus;
        case 2:
            return FullName;
        case 3:
            return ID;
        case 4:
            return KindergardenID;
        case 5:
            return URL;
        case 6:
            return PickUpBy;
        case 7:
            return PickUpWithKidID;
        case 8:
            return PickUpWithKidName;
        }

        return null;
    }

    public int getPropertyCount() {
        // TODO Auto-generated method stub
        return 9;
    }

    public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
        // TODO Auto-generated method stub
        switch(index)
        {
        case 0:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "CheckOutPlanned";
            break;
        case 1:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "CurrentStatus";
            break;
        case 2:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "FullName";
            break;
        case 3:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "ID";
            break;
        case 4:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "KindergardenID";
            break;
        case 5:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "URL";
            break;
        case 6:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "PickUpBy";
            break;
        case 7:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "PickUpWithKidID";
            break;
        case 8:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "PickUpWithKidName";
            break;
        default:
            break;
        }
    }

    public void setProperty(int index, Object value) {
        // TODO Auto-generated method stub
        switch(index)
        {
        case 0:
            CheckOutPlanned = value.toString();
            break;
        case 1:
            CurrentStatus = value.toString();
            break;
        case 2:
            FullName = value.toString();
            break;
        case 3:
            ID = value.toString();
            break;
        case 4:
            KindergardenID = value.toString();
            break;
        case 5:
            URL = value.toString();
            break;
        case 6:
            PickUpBy = value.toString();
            break;
        case 7:
            PickUpWithKidID = value.toString();
            break;
        case 8:
            PickUpWithKidName = value.toString();
            break;
        default:
            break;
        }
    }

}

Now how do I then use the array of objects in a class?

I saw somewhere, that I need to do something like this:

ArrayList<MyClass> myList = new ArrayList<MyClass>();

myList.add( new MyClass() );

myList.get( 0 ).myMethodFromMyClass();

So in my case:

ArrayList<ChildStatus> myChild = new ArrayList<ChildStatus>();
myChild.add( new ChildStatus() );
myChild.get(0).??

But I think I might be off in some wrong direction here, because with .add it sounds like I’m adding a new object, and not getting the ones I retrieved in my web call…

In iOS I normally use:

Status *theStatus = [statusConnection.statusArray objectAtIndex:i];

to get an object from an array of objects, but I’m fairly new to Android…

I would really appreciate any help you can give me!

  • 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-03T22:01:12+00:00Added an answer on June 3, 2026 at 10:01 pm

    I kinda have a hard time understanding what you really want to do.

    // Get rid of the table
    REMOVE ChildStatus[] children = new ChildStatus[count]; 
    
    // Create the ArrayList
    ArrayList<ChildStatus> myChild = new ArrayList<ChildStatus>();  
    
    for (int i = 0; i < count; i++) 
    {   
        ChildStatus childStatus = new ChildStatus(); 
    
        ...
        HERE YOU POPULATE YOUR childStatus OBJECT WITH THE SOAPOBJECT
        ...
    
        // Add objects built from SOAPObject to the ArrayList
        myChild.add(childStatus);
    
        // The table is of no matter here 
        REMOVE children[i] = childStatus; 
    } 
    
    // Use inner methods from an element of the ArrayList (here the number of properties for the first element)
    myChild.get(0).getPropertyCount()
    

    I might have been misleaded by the question you were asking, sorry if this is not what you were looking for.

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

Sidebar

Related Questions

I've been searching a lot for this problem and I can't find a solution.
my problem:--- This is my wifi_log.php file <?php // find out how many rows
I've got the following problem - This is my log4j config file: log4j.rootLogger=info, stdout,
The problem this: at the end of this function, the members of the element
I got a big problem this morning. My SQL Server had a HUGE bug
I got a problem similar to this one: FileSystemWatcher - only the change event
Weird problem this. I've got a web page that fades images in and out
I'm trying to get element by name, and I have a problem This is
guys. I met this problem this afternoon. I don't want a different span.... My
Problem This question actually came up at work today. We are planning an experiment

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.