无法从Android中的SOAP请求获得完整的字符串响应

时间:2013-05-22 05:56:41

标签: android-ksoap2

我正在使用kso​​ap2来处理SOAP服务。我的问题是我能够从Soap Request获得完美的小响应。当我尝试从SOAP请求获取大数据时,我没有从服务获得完整响应。我只获得了一些String响应。任何人都可以建议我如何解决我的问题?

以下是我在logact中收到回复之前收到的错误。

06-03 05:54:20.481: E/ActivityThread(701): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d1c478 that was originally bound here
06-03 05:54:20.481: E/ActivityThread(701): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d1c478 that was originally bound here
06-03 05:54:20.481: E/ActivityThread(701):  at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
06-03 05:54:20.481: E/ActivityThread(701):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
06-03 05:54:20.481: E/ActivityThread(701):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
06-03 05:54:20.481: E/ActivityThread(701):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
06-03 05:54:20.481: E/ActivityThread(701):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
06-03 05:54:20.481: E/ActivityThread(701):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
06-03 05:54:20.481: E/ActivityThread(701):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
06-03 05:54:20.481: E/ActivityThread(701):  at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
06-03 05:54:20.481: E/ActivityThread(701):  at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
06-03 05:54:20.481: E/ActivityThread(701):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
06-03 05:54:20.481: E/ActivityThread(701):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
06-03 05:54:20.481: E/ActivityThread(701):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
06-03 05:54:20.481: E/ActivityThread(701):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-03 05:54:20.481: E/ActivityThread(701):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-03 05:54:20.481: E/ActivityThread(701):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-03 05:54:20.481: E/ActivityThread(701):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-03 05:54:20.481: E/ActivityThread(701):  at java.lang.Thread.run(Thread.java:856)
06-03 05:54:20.621: E/StrictMode(701): null
06-03 05:54:20.621: E/StrictMode(701): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d1c478 that was originally bound here
06-03 05:54:20.621: E/StrictMode(701):  at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
06-03 05:54:20.621: E/StrictMode(701):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
06-03 05:54:20.621: E/StrictMode(701):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
06-03 05:54:20.621: E/StrictMode(701):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
06-03 05:54:20.621: E/StrictMode(701):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
06-03 05:54:20.621: E/StrictMode(701):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
06-03 05:54:20.621: E/StrictMode(701):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
06-03 05:54:20.621: E/StrictMode(701):  at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
06-03 05:54:20.621: E/StrictMode(701):  at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
06-03 05:54:20.621: E/StrictMode(701):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
06-03 05:54:20.621: E/StrictMode(701):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
06-03 05:54:20.621: E/StrictMode(701):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
06-03 05:54:20.621: E/StrictMode(701):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-03 05:54:20.621: E/StrictMode(701):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-03 05:54:20.621: E/StrictMode(701):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-03 05:54:20.621: E/StrictMode(701):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-03 05:54:20.621: E/StrictMode(701):  at java.lang.Thread.run(Thread.java:856)

编辑1:

06-03 06:09:46.440: W/Trace(1347): Unexpected value from nativeGetEnabledTags: 0
06-03 06:09:46.440: D/StrictMode(1347): StrictMode policy violation; ~duration=3980 ms: android.os.StrictMode$StrictModeNetworkViolation: policy=31 violation=4
06-03 06:09:46.440: D/StrictMode(1347):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1123)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:84)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.io.IoBridge.connectErrno(IoBridge.java:144)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.io.IoBridge.connect(IoBridge.java:112)
06-03 06:09:46.440: D/StrictMode(1347):     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
06-03 06:09:46.440: D/StrictMode(1347):     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
06-03 06:09:46.440: D/StrictMode(1347):     at java.net.Socket.connect(Socket.java:842)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:76)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpEngine.connect(HttpEngine.java:311)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)
06-03 06:09:46.440: D/StrictMode(1347):     at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81)
06-03 06:09:46.440: D/StrictMode(1347):     at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:76)
06-03 06:09:46.440: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:146)
06-03 06:09:46.440: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
06-03 06:09:46.440: D/StrictMode(1347):     at com.example.mytranzz.StopList.onCreate(StopList.java:85)
06-03 06:09:46.440: D/StrictMode(1347):     at android.app.Activity.performCreate(Activity.java:5104)
06-03 06:09:46.440: D/StrictMode(1347):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-03 06:09:46.440: D/StrictMode(1347):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-03 06:09:46.440: D/StrictMode(1347):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-03 06:09:46.440: D/StrictMode(1347):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-03 06:09:46.440: D/StrictMode(1347):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-03 06:09:46.440: D/StrictMode(1347):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-03 06:09:46.440: D/StrictMode(1347):     at android.os.Looper.loop(Looper.java:137)
06-03 06:09:46.440: D/StrictMode(1347):     at android.app.ActivityThread.main(ActivityThread.java:5039)
06-03 06:09:46.440: D/StrictMode(1347):     at java.lang.reflect.Method.invokeNative(Native Method)
06-03 06:09:46.440: D/StrictMode(1347):     at java.lang.reflect.Method.invoke(Method.java:511)
06-03 06:09:46.440: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-03 06:09:46.440: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-03 06:09:46.440: D/StrictMode(1347):     at dalvik.system.NativeStart.main(Native Method)
06-03 06:09:46.451: D/StrictMode(1347): StrictMode policy violation; ~duration=3818 ms: android.os.StrictMode$StrictModeNetworkViolation: policy=31 violation=4
06-03 06:09:46.451: D/StrictMode(1347):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1123)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.io.BlockGuardOs.poll(BlockGuardOs.java:117)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.io.IoBridge.isConnected(IoBridge.java:200)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.io.IoBridge.connectErrno(IoBridge.java:161)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.io.IoBridge.connect(IoBridge.java:112)
06-03 06:09:46.451: D/StrictMode(1347):     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
06-03 06:09:46.451: D/StrictMode(1347):     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
06-03 06:09:46.451: D/StrictMode(1347):     at java.net.Socket.connect(Socket.java:842)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:76)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpEngine.connect(HttpEngine.java:311)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81)
06-03 06:09:46.451: D/StrictMode(1347):     at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:76)
06-03 06:09:46.451: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:146)
06-03 06:09:46.451: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
06-03 06:09:46.451: D/StrictMode(1347):     at com.example.mytranzz.StopList.onCreate(StopList.java:85)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.Activity.performCreate(Activity.java:5104)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-03 06:09:46.451: D/StrictMode(1347):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-03 06:09:46.451: D/StrictMode(1347):     at android.os.Looper.loop(Looper.java:137)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.main(ActivityThread.java:5039)
06-03 06:09:46.451: D/StrictMode(1347):     at java.lang.reflect.Method.invokeNative(Native Method)
06-03 06:09:46.451: D/StrictMode(1347):     at java.lang.reflect.Method.invoke(Method.java:511)
06-03 06:09:46.451: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-03 06:09:46.451: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-03 06:09:46.451: D/StrictMode(1347):     at dalvik.system.NativeStart.main(Native Method)
06-03 06:09:46.451: D/StrictMode(1347): StrictMode policy violation; ~duration=3640 ms: android.os.StrictMode$StrictModeNetworkViolation: policy=31 violation=4
06-03 06:09:46.451: D/StrictMode(1347):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1123)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:163)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.io.IoBridge.recvfrom(IoBridge.java:513)
06-03 06:09:46.451: D/StrictMode(1347):     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
06-03 06:09:46.451: D/StrictMode(1347):     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
06-03 06:09:46.451: D/StrictMode(1347):     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
06-03 06:09:46.451: D/StrictMode(1347):     at java.io.InputStream.read(InputStream.java:163)
06-03 06:09:46.451: D/StrictMode(1347):     at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
06-03 06:09:46.451: D/StrictMode(1347):     at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.io.Streams.readAsciiLine(Streams.java:201)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
06-03 06:09:46.451: D/StrictMode(1347):     at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:177)
06-03 06:09:46.451: D/StrictMode(1347):     at org.ksoap2.transport.ServiceConnectionSE.openInputStream(ServiceConnectionSE.java:113)
06-03 06:09:46.451: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:160)
06-03 06:09:46.451: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
06-03 06:09:46.451: D/StrictMode(1347):     at com.example.mytranzz.StopList.onCreate(StopList.java:85)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.Activity.performCreate(Activity.java:5104)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-03 06:09:46.451: D/StrictMode(1347):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-03 06:09:46.451: D/StrictMode(1347):     at android.os.Looper.loop(Looper.java:137)
06-03 06:09:46.451: D/StrictMode(1347):     at android.app.ActivityThread.main(ActivityThread.java:5039)
06-03 06:09:46.451: D/StrictMode(1347):     at java.lang.reflect.Method.invokeNative(Native Method)
06-03 06:09:46.451: D/StrictMode(1347):     at java.lang.reflect.Method.invoke(Method.java:511)
06-03 06:09:46.451: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-03 06:09:46.451: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-03 06:09:46.451: D/StrictMode(1347):     at dalvik.system.NativeStart.main(Native Method)
06-03 06:09:46.461: D/StrictMode(1347): StrictMode policy violation; ~duration=1600 ms: android.os.StrictMode$StrictModeNetworkViolation: policy=31 violation=4
06-03 06:09:46.461: D/StrictMode(1347):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1123)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:163)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.io.IoBridge.recvfrom(IoBridge.java:513)
06-03 06:09:46.461: D/StrictMode(1347):     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
06-03 06:09:46.461: D/StrictMode(1347):     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
06-03 06:09:46.461: D/StrictMode(1347):     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
06-03 06:09:46.461: D/StrictMode(1347):     at java.io.InputStream.read(InputStream.java:163)
06-03 06:09:46.461: D/StrictMode(1347):     at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
06-03 06:09:46.461: D/StrictMode(1347):     at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.io.Streams.readAsciiLine(Streams.java:201)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.net.http.HttpEngine.readHeaders(HttpEngine.java:621)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:574)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:177)
06-03 06:09:46.461: D/StrictMode(1347):     at org.ksoap2.transport.ServiceConnectionSE.openInputStream(ServiceConnectionSE.java:113)
06-03 06:09:46.461: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:160)
06-03 06:09:46.461: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
06-03 06:09:46.461: D/StrictMode(1347):     at com.example.mytranzz.StopList.onCreate(StopList.java:85)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.Activity.performCreate(Activity.java:5104)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-03 06:09:46.461: D/StrictMode(1347):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-03 06:09:46.461: D/StrictMode(1347):     at android.os.Looper.loop(Looper.java:137)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.main(ActivityThread.java:5039)
06-03 06:09:46.461: D/StrictMode(1347):     at java.lang.reflect.Method.invokeNative(Native Method)
06-03 06:09:46.461: D/StrictMode(1347):     at java.lang.reflect.Method.invoke(Method.java:511)
06-03 06:09:46.461: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-03 06:09:46.461: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-03 06:09:46.461: D/StrictMode(1347):     at dalvik.system.NativeStart.main(Native Method)
06-03 06:09:46.461: D/StrictMode(1347): StrictMode policy violation; ~duration=1449 ms: android.os.StrictMode$StrictModeNetworkViolation: policy=31 violation=4
06-03 06:09:46.461: D/StrictMode(1347):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1123)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:163)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.io.IoBridge.recvfrom(IoBridge.java:513)
06-03 06:09:46.461: D/StrictMode(1347):     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
06-03 06:09:46.461: D/StrictMode(1347):     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
06-03 06:09:46.461: D/StrictMode(1347):     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
06-03 06:09:46.461: D/StrictMode(1347):     at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
06-03 06:09:46.461: D/StrictMode(1347):     at libcore.net.http.FixedLengthInputStream.read(FixedLengthInputStream.java:45)
06-03 06:09:46.461: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:176)
06-03 06:09:46.461: D/StrictMode(1347):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
06-03 06:09:46.461: D/StrictMode(1347):     at com.example.mytranzz.StopList.onCreate(StopList.java:85)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.Activity.performCreate(Activity.java:5104)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-03 06:09:46.461: D/StrictMode(1347):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-03 06:09:46.461: D/StrictMode(1347):     at android.os.Looper.loop(Looper.java:137)
06-03 06:09:46.461: D/StrictMode(1347):     at android.app.ActivityThread.main(ActivityThread.java:5039)
06-03 06:09:46.461: D/StrictMode(1347):     at java.lang.reflect.Method.invokeNative(Native Method)
06-03 06:09:46.461: D/StrictMode(1347):     at java.lang.reflect.Method.invoke(Method.java:511)
06-03 06:09:46.461: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-03 06:09:46.461: D/StrictMode(1347):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-03 06:09:46.461: D/StrictMode(1347):     at dalvik.system.NativeStart.main(Native Method)
06-03 06:09:46.481: D/dalvikvm(1347): GC_CONCURRENT freed 338K, 13% free 4047K/4600K, paused 4ms+4ms, total 260ms
**strong text**.

EDIT2:

  public void onCreate(Bundle savedInstanceState) {

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);

    //Remove notification bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.stoplist);
    getStopsNamesList();

    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);


    new Thread(new Runnable() { 
        public void run(){

            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

            SoapSerializationEnvelope soapEnvelop =  new SoapSerializationEnvelope(SoapEnvelope.VER11);
            soapEnvelop.dotNet = true;
            soapEnvelop.implicitTypes = true;
            soapEnvelop.enc = SoapSerializationEnvelope.ENC2003;
            soapEnvelop.xsd = SoapEnvelope.XSD;
            soapEnvelop.xsi = SoapEnvelope.XSI;
            soapEnvelop.setAddAdornments(false);

            soapEnvelop.setOutputSoapObject(request);

            HttpTransportSE aht = new HttpTransportSE (URL);
            System.out.println("Before try catche");

            try
            {
                aht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
                aht.debug = true;

                aht.call(SOAP_ACTION, soapEnvelop);



                 final SoapPrimitive response = (SoapPrimitive) soapEnvelop.getResponse();
                 String str = response.toString();
                 String strcheck = str;

                 Log.d("WS",strcheck);

                 if (soapEnvelop.bodyIn instanceof SoapFault)
                 {
                        String str1= ((SoapFault) soapEnvelop.bodyIn).faultstring;
                        Log.i("", str1);
                 } 
                 else
                 {
                      SoapObject resultsRequestSOAP = (SoapObject) soapEnvelop.bodyIn;
                      Log.d("WS", String.valueOf(resultsRequestSOAP));

                 } 
            }

            catch (Exception ex)
            {
                System.out.println("Exception : " + ex);
                ex.printStackTrace();
            }

        }
}).start();



    btnSaveStopInfo = (Button) findViewById(R.id.btnSaveStopInfo);
    btnSaveStopInfo.setOnClickListener(this);

    location = getIntent().getExtras().getString("fromLocation");


    lv= (ListView) findViewById(R.id.listview);
    inputSearch = (EditText) findViewById(R.id.inputSearch);

    adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_single_choice,stopsList);

    lv.setAdapter(adapter);
    inputSearch.addTextChangedListener(new TextWatcher() {

        public void onTextChanged(CharSequence cs, int arg1, int arg2,
                int arg3) {
            // When user changed the Text
            StopList.this.adapter.getFilter().filter(cs);
        }

        public void beforeTextChanged(CharSequence arg0, int arg1,
                int arg2, int arg3) {
            // TODO Auto-generated method stub

        }

        public void afterTextChange(Editable arg0) {
            // TODO Auto-generated method stub

        }

        public void afterTextChanged(Editable s) {
            // TODO Auto-generated method stub

        }
    });


    lv.setOnItemClickListener(new OnItemClickListener()
 {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // if(position == 1)

            String fromAdapter = adapter.getItem(position);

            selectedStop = fromAdapter;

        }
    });
}

2 个答案:

答案 0 :(得分:1)

对于第一个日志,您可以尝试以下方法:

然后是第二个日志: (错误:android.os.StrictMode$StrictModeNetworkViolation: policy=31 violation=4

尝试thisthis。基本上,在进行Web服务等网络调用时,应该在单独的线程上进行,而不是在主UI线程上进行。

答案 1 :(得分:1)

Hiii ...对于此“来自nativeGetEnabledTags的意外值:0问题See this可能对您有用。