Note that there are some explanatory texts on larger screens.

plurals
  1. POJava serialization error while sending byte array to webservice
    text
    copied!<p>I am getting an error: <code>Java.lang.RuntimeException: Cannot serialize : -119</code> while executing call method in <code>HttpTransportSE</code>.</p> <p>I have tried both adding object directly:</p> <pre><code>public String UploadPhotoCall(byte[] imageContent) SoapObject request = new SoapObject(_wsdlTargetNamespace, _operation); request.addProperty("imageContent", imageContent); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE httpTransport = new HttpTransportSE(_soapAddressLocation); Object response = null; try{ httpTransport.call(_action, envelope); response = envelope.getResponse(); } catch(IOException ex){ response = ex.toString(); } catch(Exception ex){ response = ex.toString(); } </code></pre> <p>and after reading topic <a href="https://stackoverflow.com/questions/8518651/pass-array-using-web-services-in-ksoap2">Pass Array using Web services in Ksoap2</a><br> I tried this:</p> <pre><code>SoapObject request = new SoapObject(_wsdlTargetNamespace, _operation); PropertyInfo propertyImage = new PropertyInfo(); SoapObject soapImage = ByteArrayTransform(imageContent); propertyImage.setValue(soapImage); propertyImage.setType(soapImage.getClass()); propertyImage.setName("imageContent"); request.addProperty(propertyImage); public SoapObject ByteArrayTransform(byte[] image){ SoapObject soapImage = new SoapObject(_wsdlTargetNamespace, _operation); Log.i(_TAG, "byte array transform begins"); for (int i =0; i &lt; image.length; i++){ soapImage.addProperty(Integer.toString(i), image[i]); } return soapImage; } </code></pre> <p>But it still doesn't help. Can anyone show me, how to do it in a correct way?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload