This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 7th, 2013  |  syntax: None  |  size: 0.94 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. NSURL *url = [NSURL URLWithString:@"http://w3schools.com/webservices/tempconvert.asmx"];
  2. NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]
  3. NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];
  4. [theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
  5. [theRequest addValue: @"http://tempuri.org/CelsiusToFahrenheit" forHTTPHeaderField:@"SOAPAction"];
  6. [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
  7. [theRequest setHTTPMethod:@"POST"];
  8. [theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
  9. NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
  10.  
  11. if( theConnection )
  12. {
  13. webData = [[NSMutableData data] retain];
  14. }
  15. else
  16. {
  17.  NSLog(@"theConnection is NULL");
  18. }
  19.        
  20. for()
  21. {
  22.     newSize = oldSize++;
  23.     newStr = malloc(newSize);
  24.     newStr = strcat(oldStr, newCharStr);
  25.     free(oldStr);
  26. }
clone this paste RAW Paste Data