title: Sending byte array with ksoap2 on android
body: <p>I'm trying to upload images from an android device to a WCF service. If I send a small image (about 20kb) then it works fine. If I send a slightly larger image (about 95kb) I get an error:</p>
  
  <pre><code>org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:1 in java.io.InputStreamReader@41636470)
  </code></pre>
  
  <p>Android code is:</p>
  
  <pre><code>    byte[] fileContents = IOUtil.readFile(image.getFileName());
      request = new SoapObject(CommonFunctions.NAMESPACE, "SaveAttachment");
      envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
      envelope.dotNet = true;
      envelope.setOutputSoapObject(request);
      new MarshalBase64().register(envelope);
      androidHttpTransport = new HttpTransportSE(CommonFunctions.SERVICE_URL);
  
      request.addProperty("SomeProperty1", somevalue1);
      request.addProperty("SomeProperty2", somevalue2);
      PropertyInfo p1=new PropertyInfo();
      p1.setName("FileContents");
      p1.setType(MarshalBase64.BYTE_ARRAY_CLASS);
      p1.setValue(fileContents);
      request.addProperty(p1);
      androidHttpTransport.call(CommonFunctions.SOAP_ACTION + "SaveAttachment", envelope);
      int fileId = Integer.parseInt(envelope.getResponse().toString());
  </code></pre>
  
  <p>The exception is thrown on the androidHttpTransport.call line after a few seconds. The breakpoint in my WCF service is never hit. I've upped the request limits on the WCF bindings:</p>
  
  <pre><code>  &lt;basicHttpBinding&gt;
      &lt;binding name="MobileIntegrationBinding" messageEncoding="Text" allowCookies="true" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"&gt;
        &lt;security mode="Transport" /&gt;
      &lt;/binding&gt;
    &lt;/basicHttpBinding&gt;
  </code></pre>
  
  <p>Is there some limit on the amount of data KSOAP will add to a property, and if so is there a way to increase this?</p>