Hi Alistair, it worked. great. thanks 4 ur reply

On Jan 13, 7:15 pm, "Alistair." <[email protected]>
wrote:
> I am not that familiar with using SOAP but I have passed images using
> Strings in the past.
>
> Can I suggest you encode your image using Base64 and then decode it on
> the Android side. You can use something like this:
>
> http://www.source-code.biz/snippets/java/2.htm
>
> Al.
>
> On Jan 13, 11:17 am, "sooraj.rit" <[email protected]> wrote:
>
> > 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 from Byte[].but when i try to reconstruct a bitmap from the
> > so obtained byte, it is a null bitmap.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 ();
> >         }
> >     }
>
> > }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to