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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:08:22+00:00 2026-06-05T18:08:22+00:00

i am new to android programming and i am trying to develop an app

  • 0

i am new to android programming and i am trying to develop an app that calls this web services, passes the values and gets a return in the form of an xml but everytime a make a request i get a return as the data entry not valid. I tried doing through Http get And Post but both are not wrking. The Url is as follows,

http://hiscentral.cuahsi.org/webservices/hiscentral.asmx?op=GetSeriesCatalogForBox2

and the code is,

HttpGet:

public class Main extends Activity implements OnClickListener   
{
 String xml=null;
 String responseBody;
 String text = null;
 @Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    findViewById(R.id.my_button).setOnClickListener(this);
}

public void onClick(View arg0) 
{
    Button b = (Button)findViewById(R.id.my_button);
    b.setClickable(false);
    new LongRunningGetIO().execute();
}

private class LongRunningGetIO extends AsyncTask <Void, Void, String> 
{


    @Override
    protected String doInBackground(Void... params) 
    {

try 
         {
        HttpClient httpclient = new DefaultHttpClient();  
         HttpContext localContext = new BasicHttpContext();
         HttpGet httpGet = new     HttpGet("http://hiscentral.cuahsi.org/webservices/hiscentral.asmx/GetSeriesCatalogForBox2?xmin=-100 &xmax=-90 &ymin=40 &ymax=55 &conceptKeyword=precipitation &beginDate=1/1/2009&endDate=1/1/2010 HTTP/1.1");
         HttpResponse response = httpclient.execute(httpGet, localContext);
          HttpEntity entity = response.getEntity();
          text = getASCIIContentFromEntity(entity);
         } 

         catch (Exception e) 
         {
             return e.getLocalizedMessage();
         }
         return text;
    }   



     catch (ClientProtocolException e)
                     {
                         e.printStackTrace();
                     } 
                     catch (IOException e)
                     {
                         e.printStackTrace();
                     }

                 } 
             catch (UnsupportedEncodingException e)
             {
              e.printStackTrace();
              }
             return responseBody;
    }
      protected void onPostExecute(String results) 
                    {
                        if (results!=null) 
                        {
                            EditText et = (EditText)findViewById(R.id.my_edit);
                            et.setText(results);
                        }
                        Button b = (Button)findViewById(R.id.my_button);
                        b.setClickable(true);
                    }
                }
            }

and the HttpPost is,

HttpPost
public class Main extends Activity implements OnClickListener   
{
String xml=null;
String responseBody;
String text = null;
@Override
public void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
findViewById(R.id.my_button).setOnClickListener(this);
}

public void onClick(View arg0) 
{
Button b = (Button)findViewById(R.id.my_button);
b.setClickable(false);
new LongRunningGetIO().execute();
}

private class LongRunningGetIO extends AsyncTask <Void, Void, String> 
{


@Override
protected String doInBackground(Void... params) 
{
 HttpClient httpclient = new DefaultHttpClient();   
         String Url = "http://hiscentral.cuahsi.org/webservices/hiscentral.asmx?op=GetSeriesCatalogForBox2";
         if(!Url.endsWith("?"))
         {
                Url += "?";
         }
         HttpPost httppost = new HttpPost(Url); 
             // Add data   

             List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(5);   
             nameValuePairs.add(new BasicNameValuePair("xmin", "-100"));
             nameValuePairs.add(new BasicNameValuePair("xmax", "-90"));
             nameValuePairs.add(new BasicNameValuePair("ymin", "40"));
             nameValuePairs.add(new BasicNameValuePair("ymax", "55"));
             nameValuePairs.add(new BasicNameValuePair("networkIDs", ""));
             nameValuePairs.add(new BasicNameValuePair("conceptKeyword", "precipitation"));
             nameValuePairs.add(new BasicNameValuePair("beginDate", "1/1/2009"));
             nameValuePairs.add(new BasicNameValuePair("endDate", "1/1/2010"));
             try 
             {         
                      httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                     //  Log.d("myapp", "works till here. 2"); 
                      HttpResponse response = httpclient.execute(httppost);
                      responseBody = EntityUtils.toString(response.getEntity());
                     //    Log.d("myapp", "response " + response.getEntity());
                     // HttpEntity entity = response.getEntity();
                      //   xml = getASCIIContentFromEntity(entity);
                     } 
                     catch (Exception e) 
                     {
                         return e.getLocalizedMessage();
                     }
             return responseBody;
    }

                     protected void onPostExecute(String results) 
                    {
                        if (results!=null) 
                        {
                            EditText et = (EditText)findViewById(R.id.my_edit);
                            et.setText(results);
                        }
                        Button b = (Button)findViewById(R.id.my_button);
                        b.setClickable(true);
                    }
                }
            }

Please Help !!
Thanx in adnvance..

  • 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-05T18:08:25+00:00Added an answer on June 5, 2026 at 6:08 pm

    You re missing networkIDs parameter in HttpGet so try this:

        http://hiscentral.cuahsi.org/webservices/hiscentral.asmx/GetSeriesCatalogForBox2?xmin=-100&xmax=-90&ymin=40&ymax=55&conceptKeyword=precipitation&
    networkIDs=YOUR_NETWORK_IDS&beginDate=1/1/2009&endDate=1/1/2010
    

    instead of

        http://hiscentral.cuahsi.org/webservices/hiscentral.asmx/GetSeriesCatalogForBox2?xmin=-100&xmax=-90&ymin=40&ymax=55&
    conceptKeyword=precipitation&beginDate=1/1/2009&endDate=1/1/2010%20HTTP/1.1
    

    and In HttpPost change your url as:

    String Url = "http://hiscentral.cuahsi.org/webservices/hiscentral.asmx/GetSeriesCatalogForBox2";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to android programming and i am trying to develop this app
I'm new in Android Programming. I'm trying to write an app that uses USB
I am new to android programming and trying to build a map activity app.
I'm new to Android programming and trying to wrap my head around this just
I'm trying to make an android app (I'm new in the Android programming world),
I'am begginer in android programming and I'am trying to create app that is logging
I'm still new to programming/Java/Android so I'm trying to understand everything I do and
I'm fairly new to Android programming, so this may be a simple question, but
I'm very new to Android programming, so this is probably something pretty basic. I
Hi I'm new to android programming, I'm trying to initiate the on click method

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.