1

I want to post uiimage into soap service and input image is into binary formate

"<ExpenseDetailReceipt>%@</ExpenseDetailReceipt>"

and send this appdelegate.imgBMeal data

appdelegate.imgBMeal=UIImagePNGRepresentation(appdelegate.imgMeal);

as image but there is some problem and I get please send data in correct formate

please help me how to do this

Deep
  • 33
  • 3

1 Answers1

1

Soap is basically an xml which is a string. Hence, your UIImagePNGRepresentation(appdelegate.imgMeal) method which does not return a string fails. The output of the UIIagePNGRepresentation() is an NSData object which you can covert to a string by using Base64 encoding. (You may use any other encoding of your choice). For more about coverting NSData to NSString using Base64 encoding, there is an SO link with many answers.. here. You may also need to check with your service provider about the encoding decoding parts.

Community
  • 1
  • 1
Ravi
  • 523
  • 8
  • 23