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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:48:27+00:00 2026-05-25T09:48:27+00:00

I develop android application in java. And, this application connects .net soap application. It

  • 0

I develop android application in java. And, this application connects .net soap application. It is ok, it works (i use http post method).
My actual problem is web service returns big and huge (especially contains html –cdata source code) data.
So, when i request (such as, getReports methods) to web service, it returns about 3 – 5 mb stream data, causes outofmemory. Because of this, i couldn’t parse it. I know my connection method cannot be true.
How can i implement truely if i make a mistake?

Thanks in advance.

String NAMESPACE = "http://tempuri.org/lorem";
String SURL = "http://www.test.com/lorem/test.asmx";
String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
xml += "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"http://tempuri.org/\">"
        + "<soapenv:Header/><soapenv:Body>"
        + "<web:getReport><web:strLang>strLang</web:strLang></web:getReport>"
        + "</soapenv:Body></soapenv:Envelope>";
URLConnection connection = url.openConnection();
HttpURLConnection httpconn = (HttpURLConnection) connection;
ByteArrayOutputStream bout = new ByteArrayOutputStream();
bout.write(xml.getBytes());
byte[] b = bout.toByteArray();
httpconn.setRequestProperty("SOAPAction", Namespace+ "/" + "getReport");
httpconn.setRequestProperty("Accept-Encoding","gzip,deflate");
httpconn.setRequestProperty("Host","www.test.com");
httpconn.setRequestMethod("POST");
httpconn.setDoInput(true);
httpconn.setDoOutput(true);
httpconn.connect();
OutputStream out = httpconn.getOutputStream();
out.write(b);
InputStreamReader isr = new InputStreamReader(httpconn.getInputStream());
BufferedReader in = new BufferedReader(isr);

String inputLine = "";
StringBuffer parsingData = new StringBuffer();
while (null != (inputLine = in.readLine())) {
    // OutOfMemory Error
    parsingData.append(inputLine);
}

/*
* parsingMethods (parsingData); 
*/
  • 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-25T09:48:27+00:00Added an answer on May 25, 2026 at 9:48 am

    Ksoap does support headers here is how

    Element AuthHeader = new Element();
    AuthHeader.setName("Auth");
    AuthHeader.setNamespace(namespace);
    
    Element element = new Element();
    element.setName("Username");
    element.setNamespace(namespace);
    element.addChild(Element.TEXT, username);
    AuthHeader.addChild(Element.ELEMENT, element);
    
    element = new Element();
    element.setName("Password");
    element.setNamespace(namespace);
    element.addChild(Element.TEXT, password);
    AuthHeader.addChild(Element.ELEMENT, element);
    
    headers[0] = AuthHeader;
    
    envelope.headerOut = headers;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop an android application, but i dont want to use the
I would like to create a server using .NET and Java client (Android application).
I want to use monodroid to develop an android application which runs as a
I use eclipse + ADT (andoid development tool) plugin to develop my android application.
I'm trying to develop an android application that uses network connection. The server is
I develop an Android application using Eclipse and the Android emulator. Sometimes I don't
Im going to develop one android application which transfer music file, contact exchange, voice
I'm using Eclipse to learn to develop Android applications in Java. I haven't used
I used Eclipse with the Android SDK to develop the original application. I ask
Is it possible to develop an android application aimed at mobile devices and also

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.