title: Sending image to SOAP webservice
body: <p>I am trying to send some texts and an image. I can send everything except the image. The problem is I dont know how to pass it.</p>
  
  <p>in .net soap webservice, image is declared as base64binary. what is the equalevant in objective c ? how should I pass it in objective c ?</p>
  
  <p>here is my code (I am sending an empty string for image, this code works but inserts nothing for image column)</p>
  
  <pre><code>NSString *soapMessage = [NSString stringWithFormat:
                           @"&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n"
                           "&lt;soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&gt;\n"
                           "&lt;soap:Body&gt;\n"
                           "&lt;insert_data xmlns=\"http://tempuri.org/\"&gt;\n"
                           "&lt;id&gt;%@&lt;/id&gt;"
                           "&lt;name&gt;%@&lt;/name&gt;"
                           "&lt;lname&gt;%@&lt;/lname&gt;"
                           "&lt;date&gt;%@&lt;/date&gt;"
                           "&lt;image1&gt;%@&lt;/image1&gt;"
                           "&lt;/insert_data&gt;"
                           "&lt;/soap:Body&gt;\n"
                           "&lt;/soap:Envelope&gt;\n",@"999",@"arif",@"yilmaz",@"2013-09-09",@""];
  
  
    (void)imagePickerController:(UIImagePickerController *)picker
   didFinishPickingMediaWithInfo:(NSDictionary *)info
   {
   [self.popoverController dismissPopoverAnimated:true];
  [popoverController release];
  
  NSString *mediaType = [info
                         objectForKey:UIImagePickerControllerMediaType];
   [self dismissModalViewControllerAnimated:YES];
  if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
      UIImage *image = [info
                        objectForKey:UIImagePickerControllerOriginalImage];
  
      /* Setting the images to the correct viewer - AY */
      if(image_counter==0){
          imageView.image = image;
          *datax = UIImagePNGRepresentation(image);   
          //********* I am getting the error here
          // "Assigning to 'NSData' from incompatible type NSData * "
      }
      else if(image_counter==1){
          imageView2.image = image;
      }
      else{
          imageView3.image = image;
      }
      if(image_counter&lt;3)
          image_counter++;
      /******************/
  
      if (newMedia)
          UIImageWriteToSavedPhotosAlbum(image,
                                         self,
                                         @selector(image:finishedSavingWithError:contextInfo:),
                                         nil);
  }
  else if ([mediaType isEqualToString:(NSString *)kUTTypeMovie])
  {
      // Code here to support video if enabled
  }
  </code></pre>
  
  <p>}</p>