无法在android中访问我的web服务

时间:2014-01-20 05:52:49

标签: android web-services

有人能告诉我这个logcat要求的是什么吗?

建议

感谢您宝贵的时间!..

logcat的

01-20 11:17:46.300: W/System.err(5279): org.xmlpull.v1.XmlPullParserException: Expected a quoted string (position:DOCDECL @1:50 in java.io.InputStreamReader@41ba6a20) 
01-20 11:17:46.320: W/System.err(5279):     at org.kxml2.io.KXmlParser.readQuotedId(KXmlParser.java:664)
01-20 11:17:46.320: W/System.err(5279):     at org.kxml2.io.KXmlParser.readExternalId(KXmlParser.java:643)
01-20 11:17:46.320: W/System.err(5279):     at org.kxml2.io.KXmlParser.readDoctype(KXmlParser.java:585)
01-20 11:17:46.320: W/System.err(5279):     at org.kxml2.io.KXmlParser.next(KXmlParser.java:418)
01-20 11:17:46.320: W/System.err(5279):     at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)
01-20 11:17:46.320: W/System.err(5279):     at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:2029)
01-20 11:17:46.320: W/System.err(5279):     at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:127)
01-20 11:17:46.320: W/System.err(5279):     at org.ksoap2.transport.Transport.parseResponse(Transport.java:100)
01-20 11:17:46.320: W/System.err(5279):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:197)
01-20 11:17:46.320: W/System.err(5279):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
01-20 11:17:46.320: W/System.err(5279):     at org.twinkle.weather.Index_Loadingpage$checkUser.CallService(Index_Loadingpage.java:182)
01-20 11:17:46.320: W/System.err(5279):     at org.twinkle.weather.Index_Loadingpage$checkUser.doInBackground(Index_Loadingpage.java:141)
01-20 11:17:46.320: W/System.err(5279):     at org.twinkle.weather.Index_Loadingpage$checkUser.doInBackground(Index_Loadingpage.java:1)
01-20 11:17:46.320: W/System.err(5279):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
01-20 11:17:46.320: W/System.err(5279):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
01-20 11:17:46.330: W/System.err(5279):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
01-20 11:17:46.330: W/System.err(5279):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
01-20 11:17:46.330: W/System.err(5279):     at java.lang.Thread.run(Thread.java:856)
01-20 11:17:46.350: E/ViewRootImpl(5279): sendUserActionEvent() mView == null

Activity.java

// TODO Auto-generated method stub

String str_macid  = Secure.getString(Index_Loadingpage.this.getContentResolver(),Secure.ANDROID_ID);


    System.out.println(">>--  macID  from Index page  :  "+str_macid);

        System.setProperty("http.keepAlive", "false");
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = false;

        String METHOD = getString(R.string.checkUser);
        String NAMESPACE = getString(R.string.namespace);
        String SOAP_ACTION = NAMESPACE+"/"+METHOD;
        String URL = getString(R.string.url);

        System.out.println("{Url :"+URL);
        SoapObject request = new SoapObject(NAMESPACE, METHOD);

        request.addProperty("userName",str_username);
        request.addProperty("password",str_password);
        request.addProperty("macId",str_macid );


        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL,15000);

        try {

            androidHttpTransport.call(SOAP_ACTION, envelope);
            SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
            String res_data = String.valueOf(result);
            System.out.println(">>--  RESPONSE  of checkUser  :  " + res_data );


        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

0 个答案:

没有答案