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:
org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:1 in java.io.InputStreamReader@41636470)
Android code is:
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());
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:
<basicHttpBinding>
<binding name="MobileIntegrationBinding" messageEncoding="Text" allowCookies="true" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
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?