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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:05:54+00:00 2026-05-15T19:05:54+00:00

In my contact management app i am using webservice to get a large xml

  • 0

In my contact management app i am using webservice to get a large xml data, that contains contact details. i use NSURLConnection class for sending requests. But i am facing problem in while getting the XML . First i get a broken XML and then I am getting the whole XML data . Can anyone figure out what is going wrong in my app. this is my piece of code that i am using.

NSData *postData = [postFields dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d",[postData length]];
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:[[NSString alloc] initWithString:Url]]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Current-Type"];
[request setHTTPBody:postData];
conn = nil;
conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];

and

-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[myData appendData:data];

NSString *theXml = [[NSString alloc] initWithData:myData encoding:NSASCIIStringEncoding];

UIAlertView *thealert = [[UIAlertView alloc] initWithTitle:@"the xml" message:theXml delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[thealert show];
[thealert release];

NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:data];
[xmlParser setDelegate:self];
[xmlParser parse];
    [xmlParser release];        
}
  • 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-15T19:05:54+00:00Added an answer on May 15, 2026 at 7:05 pm

    First of all, you really should read Using NSURLConnection in the URL Loading System Programming Guide.

    The gist is, connection:didReceiveData: might (and usually does) get called multiple times, so you should do all your processing in connectionDidFinishLoading:.

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

Sidebar

Related Questions

For a contact management system web app that allows tennants to upload lists of
I've written a contact management/communication system that records the details of people and allows
I am using the following code to open up an XML file so that
I'm working on a iPhone contacts management app. A user reported that all of
I want to upload data through CSV files in my contact management application. The
A lot of contact management programs do this - you type in a name
I am designing a contact management system and have come across an interesting issue
Setup: Contact database using 4 tables Contacts Cities States Zips Structure: CREATE TABLE `contacts`
I have a class Contact (base class),a class called Customer and a class called
I can create a contact that is not mail enabled, but how do I

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.