Web服务在android中没有响应

时间:2011-10-28 05:28:39

标签: android web-services exception

这是我尝试实现的Web服务的示例代码。我已经将所有必需的jar文件包含在内并尝试运行项目,它给了我一些错误like这就是我的logcat 我的代码看起来像这样

  private static final String URL = 
            "http://www.w3schools.com/webservices/tempconvert.asmx";    

        private static final String SOAP_ACTION = "http://tempuri.org/CelsiusToFahrenheit";
        private static final String NAMESPACE = "http://tempuri.org/";
        private static final String METHOD_NAME = "CelsiusToFarenheit";

        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);

            TextView tv= (TextView)findViewById(R.id.text);
            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

           request.addProperty("Celsius","32");

           SoapSerializationEnvelope envelope = 
                new SoapSerializationEnvelope(SoapEnvelope.VER11); 
               envelope.dotNet=true;
               envelope.setOutputSoapObject(request);
            AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);


            try {
                androidHttpTransport.call(SOAP_ACTION, envelope);

                SoapPrimitive resultString =(SoapPrimitive) envelope.getResponse();
                //tv.setHint("Received :" +resultString.toString());
                tv.setText("status" +resultString);
            }
                catch (Exception e) {

                e.printStackTrace();
            }

        }
    }

帮助我。提前致谢

10-28 11:01:13.501: INFO/AndroidRuntime(369): NOTE: attach of thread 'Binder Thread #3' failed
10-28 11:01:14.452: DEBUG/AndroidRuntime(382): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
10-28 11:01:14.452: DEBUG/AndroidRuntime(382): CheckJNI is ON
10-28 11:01:14.992: DEBUG/AndroidRuntime(382): --- registering native functions ---
10-28 11:01:16.571: INFO/ActivityManager(67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.option.matrix/.act }
10-28 11:01:17.041: DEBUG/AndroidRuntime(382): Shutting down VM
10-28 11:01:17.080: DEBUG/dalvikvm(382): Debugger has detached; object registry had 1 entries
10-28 11:01:17.111: INFO/ActivityManager(67): Start proc com.option.matrix for activity com.option.matrix/.act: pid=389 uid=10035 gids={3003, 1015}
10-28 11:01:17.152: INFO/AndroidRuntime(382): NOTE: attach of thread 'Binder Thread #3' failed
10-28 11:01:18.322: WARN/Resources(389): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}
10-28 11:01:20.121: INFO/ActivityManager(67): Displayed activity com.option.matrix/.act: 3093 ms (total 3093 ms)
10-28 11:01:25.261: DEBUG/dalvikvm(188): GC_EXPLICIT freed 168 objects / 11800 bytes in 95ms
10-28 11:01:30.311: DEBUG/dalvikvm(127): GC_EXPLICIT freed 760 objects / 44080 bytes in 139ms
10-28 11:01:35.270: DEBUG/dalvikvm(266): GC_EXPLICIT freed 46 objects / 2192 bytes in 96ms
10-28 11:01:41.564: DEBUG/SntpClient(67): request time failed: java.net.SocketException: Address family not supported by protocol
10-28 11:01:55.622: DEBUG/AndroidRuntime(397): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
10-28 11:01:55.622: DEBUG/AndroidRuntime(397): CheckJNI is ON
10-28 11:01:56.090: DEBUG/AndroidRuntime(397): --- registering native functions ---
10-28 11:01:57.630: DEBUG/dalvikvm(188): GC_EXPLICIT freed 111 objects / 6024 bytes in 116ms
10-28 11:01:57.760: DEBUG/PackageParser(67): Scanning package: /data/app/vmdl12881.tmp
10-28 11:01:57.792: INFO/PackageParser(67): com.option.matrix: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE
10-28 11:01:58.090: INFO/PackageManager(67): Removing non-system package:com.option.matrix
10-28 11:01:58.090: INFO/ActivityManager(67): Force stopping package com.option.matrix uid=10035
10-28 11:01:58.151: INFO/Process(67): Sending signal. PID: 389 SIG: 9
10-28 11:01:58.202: INFO/WindowManager(67): WIN DEATH: Window{43fe7498 com.option.matrix/com.option.matrix.act paused=false}
10-28 11:01:58.250: INFO/UsageStats(67): Unexpected resume of com.android.launcher while already resumed in com.option.matrix
10-28 11:01:58.500: WARN/InputManagerService(67): Got RemoteException sending setActive(false) notification to pid 389 uid 10035
10-28 11:01:59.031: DEBUG/PackageManager(67): Scanning package com.option.matrix
10-28 11:01:59.040: INFO/PackageManager(67): Package com.option.matrix codePath changed from /data/app/com.option.matrix-2.apk to /data/app/com.option.matrix-1.apk; Retaining data and using new
10-28 11:01:59.050: INFO/PackageManager(67): /data/app/com.option.matrix-1.apk changed; unpacking
10-28 11:01:59.072: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/com.option.matrix-1.apk' ---
10-28 11:01:59.532: DEBUG/dalvikvm(404): DexOpt: 'Lorg/xmlpull/v1/XmlPullParser;' has an earlier definition; blocking out
10-28 11:01:59.532: DEBUG/dalvikvm(404): DexOpt: 'Lorg/kxml2/io/KXmlParser;' has an earlier definition; blocking out
10-28 11:01:59.551: DEBUG/dalvikvm(404): DexOpt: 'Lorg/xmlpull/v1/XmlSerializer;' has an earlier definition; blocking out
10-28 11:01:59.551: DEBUG/dalvikvm(404): DexOpt: 'Lorg/kxml2/io/KXmlSerializer;' has an earlier definition; blocking out
10-28 11:01:59.561: DEBUG/dalvikvm(404): DexOpt: 'Lorg/kxml2/kdom/Node;' has an earlier definition; blocking out
10-28 11:01:59.571: DEBUG/dalvikvm(404): DexOpt: 'Lorg/kxml2/kdom/Document;' has an earlier definition; blocking out
10-28 11:01:59.571: DEBUG/dalvikvm(404): DexOpt: 'Lorg/kxml2/kdom/Element;' has an earlier definition; blocking out
10-28 11:01:59.590: DEBUG/dalvikvm(404): DexOpt: 'Lorg/xmlpull/v1/XmlPullParserException;' has an earlier definition; blocking out
10-28 11:01:59.590: DEBUG/dalvikvm(404): DexOpt: 'Lorg/xmlpull/v1/XmlPullParserFactory;' has an earlier definition; blocking out
10-28 11:01:59.811: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.811: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.831: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.841: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.841: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.851: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.870: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.880: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:01:59.890: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/kxml2/io/KXmlSerializer;'
10-28 11:01:59.911: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParser;': multiple definitions
10-28 11:01:59.911: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/kxml2/io/KXmlParser;': multiple definitions
10-28 11:01:59.911: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlSerializer;': multiple definitions
10-28 11:01:59.921: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/kxml2/io/KXmlSerializer;': multiple definitions
10-28 11:01:59.931: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/kxml2/kdom/Node;': multiple definitions
10-28 11:01:59.931: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/kxml2/kdom/Document;': multiple definitions
10-28 11:01:59.931: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/kxml2/kdom/Element;': multiple definitions
10-28 11:01:59.960: INFO/dalvikvm(404): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParserException;'
10-28 11:01:59.991: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParserException;': multiple definitions
10-28 11:01:59.991: DEBUG/dalvikvm(404): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParserFactory;': multiple definitions
10-28 11:02:00.050: DEBUG/dalvikvm(404): DexOpt: load 141ms, verify 432ms, opt 20ms
10-28 11:02:00.111: DEBUG/installd(35): DexInv: --- END '/data/app/com.option.matrix-1.apk' (success) ---
10-28 11:02:00.121: WARN/PackageManager(67): Code path for pkg : com.option.matrix changing from /data/app/com.option.matrix-2.apk to /data/app/com.option.matrix-1.apk
10-28 11:02:00.121: WARN/PackageManager(67): Resource path for pkg : com.option.matrix changing from /data/app/com.option.matrix-2.apk to /data/app/com.option.matrix-1.apk
10-28 11:02:00.121: DEBUG/PackageManager(67):   Activities: com.option.matrix.act
10-28 11:02:00.130: INFO/ActivityManager(67): Force stopping package com.option.matrix uid=10035
10-28 11:02:00.391: INFO/installd(35): move /data/dalvik-cache/data@app@com.option.matrix-1.apk@classes.dex -> /data/dalvik-cache/data@app@com.option.matrix-1.apk@classes.dex
10-28 11:02:00.401: DEBUG/PackageManager(67): New package installed in /data/app/com.option.matrix-1.apk
10-28 11:02:00.731: INFO/ActivityManager(67): Force stopping package com.option.matrix uid=10035
10-28 11:02:00.920: DEBUG/dalvikvm(127): GC_EXPLICIT freed 100 objects / 4248 bytes in 172ms
10-28 11:02:01.071: DEBUG/dalvikvm(67): GC_EXPLICIT freed 6919 objects / 454440 bytes in 219ms
10-28 11:02:01.590: WARN/RecognitionManagerService(67): no available voice recognition services found
10-28 11:02:01.801: DEBUG/dalvikvm(164): GC_EXPLICIT freed 2027 objects / 103008 bytes in 620ms
10-28 11:02:02.031: DEBUG/dalvikvm(67): GC_EXPLICIT freed 3663 objects / 204224 bytes in 175ms
10-28 11:02:02.090: INFO/installd(35): unlink /data/dalvik-cache/data@app@com.option.matrix-2.apk@classes.dex
10-28 11:02:02.121: DEBUG/AndroidRuntime(397): Shutting down VM
10-28 11:02:02.151: DEBUG/dalvikvm(397): Debugger has detached; object registry had 1 entries
10-28 11:02:02.192: INFO/AndroidRuntime(397): NOTE: attach of thread 'Binder Thread #3' failed
10-28 11:02:03.151: DEBUG/AndroidRuntime(410): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
10-28 11:02:03.151: DEBUG/AndroidRuntime(410): CheckJNI is ON
10-28 11:02:03.673: DEBUG/AndroidRuntime(410): --- registering native functions ---
10-28 11:02:05.451: INFO/ActivityManager(67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.option.matrix/.act }
10-28 11:02:05.642: DEBUG/AndroidRuntime(410): Shutting down VM
10-28 11:02:05.710: DEBUG/dalvikvm(410): Debugger has detached; object registry had 1 entries
10-28 11:02:05.751: INFO/ActivityManager(67): Start proc com.option.matrix for activity com.option.matrix/.act: pid=417 uid=10035 gids={3003, 1015}
10-28 11:02:05.822: INFO/AndroidRuntime(410): NOTE: attach of thread 'Binder Thread #3' failed
10-28 11:02:06.551: DEBUG/dalvikvm(33): GC_EXPLICIT freed 279 objects / 10576 bytes in 500ms
10-28 11:02:06.801: DEBUG/dalvikvm(33): GC_EXPLICIT freed 47 objects / 2040 bytes in 209ms
10-28 11:02:07.291: DEBUG/dalvikvm(33): GC_EXPLICIT freed 2 objects / 64 bytes in 441ms
10-28 11:02:07.611: WARN/Resources(417): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}
10-28 11:02:09.400: INFO/ActivityManager(67): Displayed activity com.option.matrix/.act: 3773 ms (total 3773 ms)
10-28 11:06:41.571: DEBUG/SntpClient(67): request time failed: java.net.SocketException: Address family not supported by protocol
10-28 11:11:41.580: DEBUG/SntpClient(67): request time failed: java.net.SocketException: Address family not supported by protocol
10-28 11:16:41.583: DEBUG/SntpClient(67): request time failed: java.net.SocketException: Address family not supported by protocol
10-28 11:18:40.710: DEBUG/AndroidRuntime(425): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
10-28 11:18:40.756: DEBUG/AndroidRuntime(425): CheckJNI is ON
10-28 11:18:44.668: DEBUG/AndroidRuntime(425): --- registering native functions ---
10-28 11:18:51.360: DEBUG/dalvikvm(188): GC_EXPLICIT freed 240 objects / 15472 bytes in 3581ms
10-28 11:18:51.531: DEBUG/PackageParser(67): Scanning package: /data/app/vmdl12882.tmp
10-28 11:18:51.580: INFO/PackageParser(67): com.option.matrix: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE
10-28 11:18:51.911: INFO/PackageManager(67): Removing non-system package:com.option.matrix
10-28 11:18:51.911: INFO/ActivityManager(67): Force stopping package com.option.matrix uid=10035
10-28 11:18:52.031: INFO/Process(67): Sending signal. PID: 417 SIG: 9
10-28 11:18:52.102: INFO/UsageStats(67): Unexpected resume of com.android.launcher while already resumed in com.option.matrix
10-28 11:18:52.121: INFO/WindowManager(67): WIN DEATH: Window{43ff8aa8 com.option.matrix/com.option.matrix.act paused=false}
10-28 11:18:52.587: WARN/InputManagerService(67): Got RemoteException sending setActive(false) notification to pid 417 uid 10035
10-28 11:18:53.532: DEBUG/PackageManager(67): Scanning package com.option.matrix
10-28 11:18:53.541: INFO/PackageManager(67): Package com.option.matrix codePath changed from /data/app/com.option.matrix-1.apk to /data/app/com.option.matrix-2.apk; Retaining data and using new
10-28 11:18:53.561: INFO/PackageManager(67): /data/app/com.option.matrix-2.apk changed; unpacking
10-28 11:18:53.591: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/com.option.matrix-2.apk' ---
10-28 11:18:54.120: DEBUG/dalvikvm(432): DexOpt: 'Lorg/xmlpull/v1/XmlPullParser;' has an earlier definition; blocking out
10-28 11:18:54.120: DEBUG/dalvikvm(432): DexOpt: 'Lorg/kxml2/io/KXmlParser;' has an earlier definition; blocking out
10-28 11:18:54.142: DEBUG/dalvikvm(432): DexOpt: 'Lorg/xmlpull/v1/XmlSerializer;' has an earlier definition; blocking out
10-28 11:18:54.142: DEBUG/dalvikvm(432): DexOpt: 'Lorg/kxml2/io/KXmlSerializer;' has an earlier definition; blocking out
10-28 11:18:54.151: DEBUG/dalvikvm(432): DexOpt: 'Lorg/kxml2/kdom/Node;' has an earlier definition; blocking out
10-28 11:18:54.161: DEBUG/dalvikvm(432): DexOpt: 'Lorg/kxml2/kdom/Document;' has an earlier definition; blocking out
10-28 11:18:54.171: DEBUG/dalvikvm(432): DexOpt: 'Lorg/kxml2/kdom/Element;' has an earlier definition; blocking out
10-28 11:18:54.191: DEBUG/dalvikvm(432): DexOpt: 'Lorg/xmlpull/v1/XmlPullParserException;' has an earlier definition; blocking out
10-28 11:18:54.191: DEBUG/dalvikvm(432): DexOpt: 'Lorg/xmlpull/v1/XmlPullParserFactory;' has an earlier definition; blocking out
10-28 11:18:54.450: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.467: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.480: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.480: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.490: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.500: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.521: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.542: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'
10-28 11:18:54.550: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/kxml2/io/KXmlSerializer;'
10-28 11:18:54.571: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParser;': multiple definitions
10-28 11:18:54.571: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/kxml2/io/KXmlParser;': multiple definitions
10-28 11:18:54.582: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlSerializer;': multiple definitions
10-28 11:18:54.591: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/kxml2/io/KXmlSerializer;': multiple definitions
10-28 11:18:54.591: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/kxml2/kdom/Node;': multiple definitions
10-28 11:18:54.601: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/kxml2/kdom/Document;': multiple definitions
10-28 11:18:54.620: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/kxml2/kdom/Element;': multiple definitions
10-28 11:18:54.630: INFO/dalvikvm(432): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParserException;'
10-28 11:18:54.691: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParserException;': multiple definitions
10-28 11:18:54.691: DEBUG/dalvikvm(432): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParserFactory;': multiple definitions
10-28 11:18:54.721: DEBUG/dalvikvm(432): DexOpt: load 176ms, verify 495ms, opt 13ms
10-28 11:18:54.762: DEBUG/installd(35): DexInv: --- END '/data/app/com.option.matrix-2.apk' (success) ---
10-28 11:18:54.772: WARN/PackageManager(67): Code path for pkg : com.option.matrix changing from /data/app/com.option.matrix-1.apk to /data/app/com.option.matrix-2.apk
10-28 11:18:54.772: WARN/PackageManager(67): Resource path for pkg : com.option.matrix changing from /data/app/com.option.matrix-1.apk to /data/app/com.option.matrix-2.apk
10-28 11:18:54.791: INFO/ActivityManager(67): Force stopping package com.option.matrix uid=10035
10-28 11:18:54.811: DEBUG/PackageManager(67):   Activities: com.option.matrix.act
10-28 11:18:55.210: DEBUG/dalvikvm(67): GC_FOR_MALLOC freed 9816 objects / 509592 bytes in 196ms
10-28 11:18:55.430: INFO/installd(35): move /data/dalvik-cache/data@app@com.option.matrix-2.apk@classes.dex -> /data/dalvik-cache/data@app@com.option.matrix-2.apk@classes.dex
10-28 11:18:55.441: DEBUG/PackageManager(67): New package installed in /data/app/com.option.matrix-2.apk
10-28 11:18:55.860: INFO/ActivityManager(67): Force stopping package com.option.matrix uid=10035
10-28 11:18:56.697: DEBUG/dalvikvm(127): GC_EXPLICIT freed 838 objects / 47472 bytes in 808ms
10-28 11:18:57.691: WARN/RecognitionManagerService(67): no available voice recognition services found
10-28 11:18:58.181: DEBUG/dalvikvm(164): GC_EXPLICIT freed 2023 objects / 102904 bytes in 958ms
10-28 11:18:58.401: DEBUG/dalvikvm(67): GC_EXPLICIT freed 5146 objects / 330264 bytes in 179ms
10-28 11:18:58.542: INFO/installd(35): unlink /data/dalvik-cache/data@app@com.option.matrix-1.apk@classes.dex
10-28 11:18:58.580: DEBUG/AndroidRuntime(425): Shutting down VM
10-28 11:18:58.601: DEBUG/dalvikvm(425): Debugger has detached; object registry had 1 entries
10-28 11:18:58.663: INFO/AndroidRuntime(425): NOTE: attach of thread 'Binder Thread #3' failed
10-28 11:18:59.682: DEBUG/AndroidRuntime(438): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
10-28 11:18:59.682: DEBUG/AndroidRuntime(438): CheckJNI is ON
10-28 11:19:00.302: DEBUG/AndroidRuntime(438): --- registering native functions ---
10-28 11:19:02.140: INFO/ActivityManager(67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.option.matrix/.act }
10-28 11:19:02.342: DEBUG/AndroidRuntime(438): Shutting down VM
10-28 11:19:02.430: DEBUG/dalvikvm(438): Debugger has detached; object registry had 1 entries
10-28 11:19:02.481: INFO/AndroidRuntime(438): NOTE: attach of thread 'Binder Thread #3' failed
10-28 11:19:02.836: WARN/ActivityManager(67): Activity pause timeout for HistoryRecord{43fdcb68 com.android.launcher/com.android.launcher2.Launcher}
10-28 11:19:02.901: INFO/ActivityManager(67): Start proc com.option.matrix for activity com.option.matrix/.act: pid=445 uid=10035 gids={3003, 1015}
10-28 11:19:04.341: WARN/Resources(445): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}
10-28 11:19:06.131: INFO/ActivityManager(67): Displayed activity com.option.matrix/.act: 3296 ms (total 3296 ms)
10-28 11:19:11.280: DEBUG/dalvikvm(188): GC_EXPLICIT freed 234 objects / 15520 bytes in 95ms
10-28 11:19:16.300: DEBUG/dalvikvm(127): GC_EXPLICIT freed 797 objects / 45736 bytes in 126ms
10-28 11:19:22.000: DEBUG/dalvikvm(266): GC_EXPLICIT freed 88 objects / 4216 bytes in 779ms

感谢您的回复,这是我从代码执行开始的总logcat

2 个答案:

答案 0 :(得分:0)

对我来说,似乎你在项目中也包含了XmlPullParser的实现,而android中已经存在一个。如果他们的版本不匹配,可能会导致此问题。

答案 1 :(得分:0)

尝试将此添加到AndroidManifest.xml中:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

看到你的logcat,你也需要捕获这个异常:

catch(SocketException ex)
           {
             Log.e("Error : " , "Error on soapPrimitiveData() " + ex.getMessage());
               ex.printStackTrace();
           }

我之前也遇到过类似的问题,我建议you refer this

这是一个从localhost访问Web服务的简单代码。也适用于您的情况......只需要更改URL