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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:38:15+00:00 2026-05-14T21:38:15+00:00

I am trying to retrieve information from a web service call. The following is

  • 0

I am trying to retrieve information from a web service call. The following is what I have so far. In my text view, it is showing

Map {item=anyType{key=TestKey; value=2;}; item=anyType{key=TestField; value=adsfasd; };}

When I ran that in the debugger, I can see the information above in the variable, tempvar. But the question is, how do I retrieve the information (i.e. the actual values of “key” and “value” in each of the array positions)? Yes, I know there is a lot going on in onCreate and I will fix it later.

Thanks in advance,
Monte

My codes are as follows,

import java.util.Vector;

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

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;


public class ViewHitUpActivity extends Activity {
private static final String SOAP_ACTION = "test_function";
private static final String METHOD_NAME = "test_function";
private static final String NAMESPACE = "http://www.monteandjanicechan.com/";
private static final String URL = "http://www.monteandjanicechan.com/ws/test_ws.cfc?wsdl";
// private Object resultRequestSOAP = null;
private TextView tv;

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

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
tv = (TextView)findViewById(R.id.people_view);

//SoapObject
request.addProperty("test_item", "1");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);


AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
/*
resultRequestSOAP = envelope.getResponse();
Vector tempResult = (Vector) resultRequestSOAP("test_functionReturn");
*/
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;

Vector tempResult = (Vector) resultsRequestSOAP.getProperty("test_functionReturn");

int testsize = tempResult.size();

// SoapObject test = (SoapObject) tempResult.get(0);

//String[] results = (String[]) resultRequestSOAP;

Object tempvar = tempResult.elementAt(1);

tv.setText(tempvar.toString());
}
catch (Exception aE)
{
aE.printStackTrace ();
tv.setText(aE.getClass().getName() + ": " + aE.getMessage());
}
}
} 
  • 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-14T21:38:16+00:00Added an answer on May 14, 2026 at 9:38 pm

    I actually found an alternative way to do it. I re-structured my web service using cfproperty to define the properties within the web service. And then in the web service, I am using the followings to get the properties,

    SoapObject test = (SoapObject) tempResult.get(0);

           String temp_string = (String) test.getProperty("TestKey"); 
           temp_string = temp_string + " " + (String) test.getProperty("TestField");
    

    Now, everything is working the way it should.

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

Sidebar

Related Questions

I'm trying to retrieve product information from magento by calling its web service using
I have a system I am trying to design that will retrieve information from
I'm trying to retrieve information from database with submit buttons , which have the
I am trying to retrieve information from my database. I have words like Lim
Currently I'm using a php web service to retrieve the information from MySQL. I'm
Hi I am trying to retrieve values from database. I have a row which
I am trying to retrieve data from an img element inside a html web
I am trying to build a web service in .NET, which will retrieve data
i need help with php code trying to retrieve all information from a table
I have a Java JDBC application that uses multiple threads to retrieve information from

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.