samivic / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

Receive Stream from WCF #93

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am really satisfy about your library, I am able to upload files from android 
to a WCF service.
My problem now is that the WCF once receive the file, convert it in MP3 and 
return back the stream again.

I am blocked on it, I don't know how to receive this stream and convert to 
file....

Thank you,
Giuseppe

public static String testWebService(File file) throws IOException {
        MarshalBase64 marshal = new MarshalBase64();

        byte[] raw = getBytesFromFile(file);
        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
        request.addProperty("request", raw);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11);   
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);

        marshal.register(envelope);
        HttpTransportSE httpTransport = new HttpTransportSE(URL);
        try      {
            httpTransport.call(SOAP_ACTION, envelope);
            @SuppressWarnings("unused")
            org.ksoap2.serialization.SoapPrimitive response = (org.ksoap2.serialization.SoapPrimitive) envelope.getResponse();
        String nome = response.getName();
            } catch (Exception exception){         
                exception.printStackTrace();      
                }
        return "ok";      
        } 

Original issue reported on code.google.com by porcelli...@gmail.com on 30 Nov 2011 at 12:44

GoogleCodeExporter commented 8 years ago
This problem is a ksoap library issue but just an issue on how to write that 
particular code. Some pointers are on the wiki.. otherwise ask on the mailing 
list or on stackoverflow.

Original comment by mosa...@gmail.com on 30 Apr 2012 at 6:30