android调用webservice函数往服务器上传图片,执行到ht.call这一句就挂了……
android调用webservice函数往服务器上传图片,结果执行到
HttpTransportSE ht = new HttpTransportSE(url);
ht.debug=true;
String soapaction=namespace+"/"+methodName;
try {
ht.call(soapaction, envelope); //出错的是这一句
if(envelope.getResponse()!=null){
Object soapPrimitive = envelope.getResponse();
Log.i("connectWebService", soapPrimitive.toString());
if(soapPrimitive.toString()!="上传图片失败!")
return true;
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
请各位多多提解决方法,大家共同讨论解决!!先谢谢了
错误提示:
03-15 08:32:04.478: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 964 objects / 182128 bytes in 87ms
03-15 08:32:04.756: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 214 objects / 139240 bytes in 156ms
03-15 08:32:04.766: INFO/dalvikvm-heap(279): Grow heap (frag case) to 3.308MB for 522256-byte allocation
03-15 08:32:04.858: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 84ms
03-15 08:32:05.126: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 44 objects / 261760 bytes in 65ms
03-15 08:32:05.247: INFO/dalvikvm-heap(279): Grow heap (frag case) to 4.057MB for 1046544-byte allocation
03-15 08:32:05.337: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 83ms
03-15 08:32:05.757: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 3 objects / 522312 bytes in 63ms
03-15 08:32:05.757: INFO/dalvikvm-heap(279): Grow heap (frag case) to 4.494MB for 980824-byte allocation
03-15 08:32:05.837: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 71ms
03-15 08:32:05.927: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 11 objects / 320 bytes in 64ms
03-15 08:32:05.956: INFO/dalvikvm-heap(279): Grow heap (frag case) to 5.742MB for 1307760-byte allocation
03-15 08:32:06.046: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 1 objects / 48 bytes in 86ms
03-15 08:32:17.257: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 13 objects / 981320 bytes in 65ms
03-15 08:32:17.298: INFO/dalvikvm-heap(279): Grow heap (frag case) to 7.301MB for 1743672-byte allocation
03-15 08:32:17.378: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 81ms
03-15 08:32:17.487: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 5 objects / 1743792 bytes in 64ms
03-15 08:32:18.446: INFO/dalvikvm-heap(279): Grow heap (frag case) to 9.795MB for 3487328-byte allocation
03-15 08:32:18.548: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 101ms
03-15 08:32:18.628: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 80ms
03-15 08:32:18.766: INFO/dalvikvm-heap(279): Grow heap (frag case) to 11.458MB for 1743672-byte allocation
03-15 08:32:18.878: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 103ms
03-15 08:34:10.558: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 1191 objects / 5277936 bytes in 66ms
03-15 08:35:45.958: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 1058 objects / 558776 bytes in 64ms
03-15 08:35:45.997: INFO/dalvikvm-heap(279): Grow heap (frag case) to 9.870MB for 2080784-byte allocation
03-15 08:35:46.088: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 88ms
03-15 08:35:52.418: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
03-15 08:36:35.067: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 557 objects / 3148768 bytes in 67ms
03-15 08:36:35.188: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 7 objects / 344 bytes in 73ms
03-15 08:36:35.317: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 2 objects / 48 bytes in 98ms
03-15 08:36:35.467: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 5 objects / 1744352 bytes in 94ms
03-15 08:36:35.467: INFO/dalvikvm-heap(279): Forcing collection of SoftReferences for 3488432-byte allocation
03-15 08:36:35.537: DEBUG/dalvikvm(279): GC_FOR_MALLOC freed 0 objects / 0 bytes in 74ms
03-15 08:36:35.547: ERROR/dalvikvm-heap(279): Out of memory on a 3488432-byte allocation.
03-15 08:36:35.547: INFO/dalvikvm(279): "main" prio=5 tid=1 RUNNABLE
03-15 08:36:35.557: INFO/dalvikvm(279): | group="main" sCount=0 dsCount=0 s=N obj=0x4001d8e0 self=0xccb0
03-15 08:36:35.557: INFO/dalvikvm(279): | sysTid=279 nice=0 sched=0/0 cgrp=default handle=-1345026008
03-15 08:36:35.557: INFO/dalvikvm(279): | schedstat=( 247070998192 7803460371 2948 )
03-15 08:36:35.567: INFO/dalvikvm(279): at java.nio.CharArrayBuffer.<init>(CharArrayBuffer.java:~43)
03-15 08:36:35.576: INFO/dalvikvm(279): at java.nio.ReadWriteCharArrayBuffer.<init>(ReadWriteCharArrayBuffer.java:47)
03-15 08:36:35.576: INFO/dalvikvm(279): at java.nio.BufferFactory.newCharBuffer(BufferFactory.java:82)
03-15 08:36:35.576: INFO/dalvikvm(279): at java.nio.CharBuffer.allocate(CharBuffer.java:53)
03-15 08:36:35.586: INFO/dalvikvm(279): at java.nio.charset.CharsetDecoder.allocateMore(CharsetDecoder.java:265)
03-15 08:36:35.586: INFO/dalvikvm(279): at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:222)
03-15 08:36:35.608: INFO/dalvikvm(279): at java.nio.charset.Charset.decode(Charset.java:730)
03-15 08:36:35.608: INFO/dalvikvm(279): at java.lang.String.<init>(String.java:193)
03-15 08:36:35.608: INFO/dalvikvm(279): at java.lang.String.<init>(String.java:148)
03-15 08:36:35.617: INFO/dalvikvm(279): at org.ksoap2.transport.HttpTransportSE.call((null):-1)
03-15 08:36:35.617: INFO/dalvikvm(279): at com.cc.upAct.connectWebService(upAct.java:109)
03-15 08:36:35.627: INFO/dalvikvm(279): at com.cc.upAct.testUpload(upAct.java:54)
03-15 08:36:35.627: INFO/dalvikvm(279): at com.cc.upAct$1.onClick(upAct.java:35)
03-15 08:36:35.627: INFO/dalvikvm(279): at android.view.View.performClick(View.java:2408)
03-15 08:36:35.637: INFO/dalvikvm(279): at android.view.View$PerformClick.run(View.java:8816)
03-15 08:36:35.637: INFO/dalvikvm(279): at android.os.Handler.handleCallback(Handler.java:587)
03-15 08:36:35.637: INFO/dalvikvm(279): at android.os.Handler.dispatchMessage(Handler.java:92)
03-15 08:36:35.648: INFO/dalvikvm(279): at android.os.Looper.loop(Looper.java:123)
03-15 08:36:35.658: INFO/dalvikvm(279): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-15 08:36:35.658: INFO/dalvikvm(279): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 08:36:35.658: INFO/dalvikvm(279): at java.lang.reflect.Method.invoke(Method.java:521)
03-15 08:36:35.658: INFO/dalvikvm(279): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-15 08:36:35.658: INFO/dalvikvm(279): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-15 08:36:35.658: INFO/dalvikvm(279): at dalvik.system.NativeStart.main(Native Method)
03-15 08:40:52.426: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
03-15 08:45:52.430: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
03-15 08:50:52.438: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
03-15 08:55:52.440: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
03-15 09:00:00.197: DEBUG/dalvikvm(60): GC_FOR_MALLOC freed 11197 objects / 524896 bytes in 140ms
------解决方案--------------------
有网路访问权限吗,如果有是不是网路很慢或者连不上服务器啊