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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:43:22+00:00 2026-06-11T19:43:22+00:00

i am trying to collect some values in int array,which are from the web

  • 0

i am trying to collect some values in int array,which are from the web service by consuming it.Here i am using SOAP method for the consumption.

when i am trying to collect the values in int array, i am unable to run the emulator.

How to overcome this error? Please find my source for reference.

Main_WB.java

 public class Main_WB extends Activity 
 {
EditText edt1,edt2;
TextView txt_1;
Button btn;

 @Override
 public void onCreate(Bundle savedInstanceState) 
 {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    edt1 = (EditText)findViewById(R.id.editText1);
    edt2 = (EditText)findViewById(R.id.editText2);
    btn = (Button)findViewById(R.id.button1);

    btn.setOnClickListener(new View.OnClickListener()
    {
    public void onClick(View v) 
    {
        getTMSChart(edt1.getText().toString(),edt2.getText().toString());
    }     
    });
  }

 private void getTMSChart(String FromDate,String ToDate)
 {
     txt_1 = (TextView)findViewById(R.id.textView1);

     System.setProperty("http.keepAlive", "false");        
     SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        

     envelope.dotNet = true;

     String NAMESPACE = "http://tempuri.org/";
     String URL = "http://54.251.60.177/TMSOrdersService/TMSDetails.asmx";
     String METHOD = "GetTMSChart";

     SoapObject request = new SoapObject(NAMESPACE, METHOD);        
     request.addProperty("FromDate", FromDate);               
     request.addProperty("ToDate", ToDate);

     envelope.setOutputSoapObject(request);
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

     try 
     {
         androidHttpTransport.call(NAMESPACE + METHOD, envelope);

         SoapObject result = (SoapObject) envelope.bodyIn;

         SoapObject root =  (SoapObject) ((SoapObject)(result).getProperty(0)).getProperty("NewDataSet");

         int tablesCount = root.getPropertyCount();


      for (int i = 0; i < tablesCount; i++)
      {
         SoapObject table = (SoapObject) root.getProperty(i);
         int propertyCount = table.getPropertyCount();

      for (int j = 0; j < propertyCount; j++)
      {           

    //  String orderNo =  table.getPropertyAsString("Order_No");
    //  String freight =  table.getPropertyAsString("Freight_Rate");
    //  String percent =  table.getPropertyAsString("Margin_Percent");


       int orderNo = Integer.parseInt(table.getPropertyAsString("Order_No"));
       int freightRate = Integer.parseInt(table.getPropertyAsString("Freight_Rate"));
       int marginPercent = Integer.parseInt(table.getPropertyAsString("Margin_Percent"));

       int[] ord = new int[orderNo];
       int[] frei = new int[freightRate];
       int[] margin = new int[marginPercent];


     // whatever you do with these values

       txt_1.setText(ord);
       txt_1.setText(frei);
       txt_1.setText(margin);
          }                   
       }
    }   
    catch (Exception e) 
    {
    }   
    }    }
  • 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-11T19:43:23+00:00Added an answer on June 11, 2026 at 7:43 pm
       int orderNo = Integer.parseInt(table.getPropertyAsString("Order_No"));
       int freightRate = Integer.parseInt(table.getPropertyAsString("Freight_Rate"));
       int marginPercent = Integer.parseInt(table.getPropertyAsString("Margin_Percent"));
    
       int[] ord = new int[orderNo];
       int[] frei = new int[freightRate];
       int[] margin = new int[marginPercent];
    
    
     // whatever you do with these values
    
       txt_1.setText(ord);
       txt_1.setText(frei);
       txt_1.setText(margin);
    

    What are you trying to do here? From looking at that piece of (useless) code it seem like you lack basic programming knowledge and should perhaps read some more tutorials.

    That said I’m pointing out what you’re actually doing there:

        int orderNo = Integer.parseInt(table.getPropertyAsString("Order_No"));
    

    Here you request the property “Order_No” as a string value and convert it into an int. So far so good.

        int[] ord = new int[orderNo];
    

    Here you create an int-array with an amount of elements equal to orderNo. So if your orderNo is 12345 you create an int-array with 12345 elements. I don’t think that is what you intended.

       txt_1.setText(ord);
    

    Here you pass that huge (unintialized) int-array as a parameter to the setText method of txt_1. That method obviously wants a string value and not an int-array.

    So what are you trying to do?

    EDIT:

    To answer your question regarding creating the int-array:

    int[] ord = new int[propertyCount];
    int[] frei = new int[propertyCount];
    int[] margin = new int[propertyCount];
    
    for (int j = 0; j < propertyCount; j++)
    {           
        int orderNo = Integer.parseInt(table.getPropertyAsString("Order_No"));
        int freightRate = Integer.parseInt(table.getPropertyAsString("Freight_Rate"));
        int marginPercent = Integer.parseInt(table.getPropertyAsString("Margin_Percent"));
    
        ord[j] = orderNo;
        frei[j] = freightRate;
        margin[j] = marginPercent;
    
    }                   
    
    // process the arrays;
    

    I assume that you want one array per table so I create the arrays outside the inner loop and fill them within the loop.

    Afterwards you can process these arrays. Beware that the arrays are recreated for every table in the outer loop.

    Hope that helps.

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

Sidebar

Related Questions

I am trying to collect the values from command line using Getopt::Std in my
I am trying to collect some data from multiple subsets of a data set
I have daily reports I'm trying to collect en masse from a remote web
I'm trying to collect some information from a Atom formatted feed and display it
With Node I am trying to collect user data from an LDAP server and
Using C#, asp.net 3.5, SqlServer 2005, Trying to incorporate some inversion of control together
I'm trying to do some calculations within a SELECT query, using user variables to
I'm trying to compile some .less files using django-pipeline . When I run collectstatic
I am trying to retrieve data from a table from some old legacy work,
I'm try to collect some information from the job tracker. For starters I'd like

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.