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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:33:45+00:00 2026-06-15T23:33:45+00:00

I am using this method to get xml file from a remote server, I

  • 0

I am using this method to get xml file from a remote server, I use another parser class to parse it, and it got parsed successfully. However, when i use Log.d("get xml", xml) to check the content of the xml file, it only shows <?xml version="1.0" standalone="no"?> in logCat. Why?

public String getXmlFromUrl(String url) {
    String xml = null;

    try {
        // defaultHttpClient

        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpPost httpPost = new HttpPost(url);
        if(httpPost != null){
            Log.d("httpPost", "httpPost not null");
        }
        HttpResponse httpResponse = httpClient.execute(httpPost);
        if(httpResponse != null){
            Log.d("httpResponse", "httpResponse not null");
        }
        HttpEntity httpEntity = httpResponse.getEntity();
        xml = EntityUtils.toString(httpEntity);

    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    // return XML
    Log.d("get xml", xml);
    if(xml!=null){
        Log.d("get http client", "get http client not null");
    }
    return xml;
}
  • 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-15T23:33:46+00:00Added an answer on June 15, 2026 at 11:33 pm

    I think the problem wasn’t the request but the output in the LogCat. Logging every line separately obtained the desired full response!.

    So check this by applying breakpoint in debug mode. Might its help to you.

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

Sidebar

Related Questions

I am using a NSXMLParserDelegate method to get the data from XML file but
I am using this method to get a list of week start from my
I have a string in an XML file that looks similar to this: M:Namespace.Class.Method(Something
To get all contacts I'm using ABAddressBookCopyArrayOfAllPeople method but, this method return all contacts
I am using NSURLConnection to fetch XML data from the server. I am parsing
Following this link I tried sending a XML file to my web service using
I am using Python's elementtree library to parse an .XML file that I exported
I'm having trouble getting the XML from a file using the simplexml_load_file function. I
I'm trying to read an object from a XML file using XMLDecoder. The construction
I'm trying to parse an XML file of tweets as retreived from Twitter's restful

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.