title: Sending image in base64 with SOAP in iOS Objective-C
body: <p>I am a newbie in iOS development. I am trying to send a clicked image by encoding it into base64 format using SOAP. I don't know how to do this. </p>
  
  <p>This is my imagePickerController delegate:</p>
  
  <pre><code>  // delegate method for picking images
  - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
    {
       NSString *mediaType = [info valueForKey:UIImagePickerControllerMediaType];
  
      if([mediaType isEqualToString:(NSString*)kUTTypeImage])
     {
      UIImage *photoTaken = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
  
      //Save Photo to library only if it wasnt already saved i.e. its just been taken
       if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) 
        {
          UIImageWriteToSavedPhotosAlbum(photoTaken, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
  
       NSData *data=[[NSData alloc] initWithData:UIImagePNGRepresentation(photoTaken)];
          base64= [[NSString alloc]init];
          base64 =[data base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn];    
        }
      }
  
  //   [picker dismissModalViewControllerAnimated:YES];
  
      [picker dismissViewControllerAnimated:YES completion:NULL];
      [picker release];
  }
  </code></pre>