0

I have a service running which return a byte array. The service is written is C# (asmx file). I request the service to send back an image that is encoded with MemoryStream in the service and is received by the application in byte array. The next thing I did is that I converted the byte array as follows:

 Object o = resultsRequestSOAP.getProperty("ImageTransformationResult");

  String result = o.toString();
  byte[] data = result.getBytes();

  Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length);

  SaveImageToSdCard(bmp);

The image that is saved is empty. Any idea what I am doing wrong? I found out that the problem may be that the encoding used on the server is not the same as the decoding I am using.

Hamid Shatu
  • 9,664
  • 4
  • 30
  • 41

0 Answers0