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

  • Home
  • SEARCH
  • 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 4323574
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:01:13+00:00 2026-05-21T09:01:13+00:00

again i am trying with soap method, but this time i downloaded the charles

  • 0

again i am trying with soap method, but this time i downloaded the charles and observe the request that i create from my code. Chales showing “failed to parse data(org.xml.sax.saxparser exception:content is not allowed in prolog)”

here is my code:

   NSString *soapMsg = [[NSString alloc] initWithFormat:@"\n"
                         "\n"
                         ""
                         "\n"
                         "%@\n"
                         "%@\n"                                                                                                              
                         "%@\n"
                         "%@\n"
                         "\n"
                         "\n"
                         "\n",str1,str2,str3,str4];                       
        NSLog(soapMsg);

    NSURL *url = [NSURL URLWithString:@"http://192.168.0.218:84/WebServiceCustomerByAmit/Service.asmx?op=InsertCustomerInformation"];
    NSLog(@"url. . . .%@", url);
    NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];    
    NSLog(@"req....%@", req); 
    NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMsg length]];


    NSLog(@"msgLength. . .%@", msgLength);
    [req addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
    [req addValue: @"http://tempuri.org/InsertCustomerInformation" forHTTPHeaderField:@"SOAPAction"];
    [req addValue: msgLength forHTTPHeaderField:@"Content-Length"];
    [req setHTTPMethod:@"POST"];
    [req setHTTPBody: [soapMsg dataUsingEncoding:NSUTF8StringEncoding]];
    NSLog(@"req....%@", req);
    NSError *error;
    NSURLResponse *response;
    //NSData *urlData=[NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&error];


     NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:req delegate:self];

     if( theConnection )
     {
         //webData = [[NSMutableData data] retain];
         NSLog(@"theConnection is OK");
     }
     else
     {
         NSLog(@"theConnection is NULL");
     }





     if(!response){
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Connection Error" message:@"Failed to Connect to the Internet" delegate:self  cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
        [alert release];
    }

    else{
        UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"Connection Successful" message:@"Connected to the Internet" delegate:self  cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert1 show];
        [alert1 release];

    }
} 


help!! thanks in advance!!

  • 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-21T09:01:14+00:00Added an answer on May 21, 2026 at 9:01 am

    You are asking how to include ASIHTTPRequest in your project, right? Copy and paste ASIHTTPRequest’s folder in your project’s folder and add this in your code:

    #import "ASIHTTPRequest.h"
    

    Note that ASIHTTPRequest is an external library and not part of the iOS SDK.

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

Sidebar

Related Questions

Again with the soap. I am trying to build a header using soap4r that
Alright, here I am again trying to write code from scratch and I can't
This time I have an error which I have been trying again to figure
I've posted this before, but I worded it poorly. I'm trying again with a
I tried posting this question earlier but was unsuccessful so I'm trying again I
Maybe that's silly, but I'm confused again when trying to find appropriate names for
Hey guys, I have a problem (again). This time I am trying to use
Edited again because it originally wasn't clear that I'm trying to initialize the arrays
(source: flickr.com ) Hi again everyone :) So today I'm trying to basically create
I'm trying to create a migration for my app, and in this app I'm

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.