Android デバイスから WCF サービスに画像をアップロードしようとしています。小さな画像 (約 20kb) を送信すると、正常に動作します。少し大きい画像 (約 95kb) を送信すると、エラーが発生します。
org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:1 in java.io.InputStreamReader@41636470)
Android コードは次のとおりです。
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());
数秒後に androidHttpTransport.call 行で例外がスローされます。私の WCF サービスのブレークポイントはヒットしません。WCF バインディングのリクエスト制限を引き上げました。
<basicHttpBinding>
<binding name="MobileIntegrationBinding" messageEncoding="Text" allowCookies="true" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
KSOAP がプロパティに追加するデータの量に制限はありますか? もしそうなら、これを増やす方法はありますか?