Hi , I am trying to download a bitmap from a web service ( created in .Net ). My web service consists of a method "GetImage" , and the server machine is returning the image stored in it as String which is converted to Byte[].but when i try to reconstruct a bitmap from the so obtained byte, it seems to be null.I have attached the source code. any sort of help is greatly appreciated.
public class HelloWeb extends Activity {
private static final String SOAP_ACTION = "http://webservice.org/ GetImage";
private static final String METHOD_NAME = "GetImage";
private static final String NAMESPACE = "http://webservice.org/";
private static final String URL = "http://10.1.26.21/Webservice/ Service1.asmx";
private Object resultRequestSOAP = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//TextView tv = new TextView(this);
ImageView tv = new ImageView(this);
setContentView(tv);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope (SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject( request );
HttpTransportSE transport = new HttpTransportSE(URL);
try
{
transport.call(SOAP_ACTION, envelope);
resultRequestSOAP = envelope.getResponse();
String results = resultRequestSOAP.toString();
byte[] bresult = results.getBytes(); //
everything is fine upto this point
Bitmap bitmap ;
bitmap = BitmapFactory.decodeByteArray(bresult , 0,
bresult.length); //here I get a null
bitmap
ImageView img = (ImageView) findViewById (R.id.ImageView01);
img.setImageBitmap(bitmap);
}
catch (Exception aE)
{
aE.printStackTrace ();
}
}
}




