这是交易:
我有一个简单的应用程序,它连接并与tomcat服务通信
它在wifi上工作正常,但在3G上失败。
将HttpTransportSE的debug属性设置为true的stacktrace告诉我它无法读取错误消息,就像它根本没有连接一样:
java.io.IOException: BufferedInputStream is closed
at java.io.BufferedInputStream.streamClosed(BufferedInputStream.java:118)
at java.io.BufferedInputStream.read(BufferedInputStream.java:279)
at org.ksoap2.transport.HttpTransportSE.readDebug(HttpTransportSE.java:273)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:241)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:116)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:111)
如果我将debug设置为false,它给我的全部是HTTP 400。
这是来电者:
httpTransport = new HttpTransportSE(service, PING_TIMEOUT);
httpTransport.debug = true;
SoapSerializationEnvelope pack = new SoapSerializationEnvelope(SoapEnvelope.VER11);
pack.setOutputSoapObject(ping);
httpTransport.call("", pack);
这很简单......