获取错误org.xmlpull.v1.XmlPullParserException:意外的令牌(位置:TEXT {AIMSStatus:' Su ... @ 1:126 in java.io.InputStreamReader@40fd84e0)

时间:2016-10-18 05:38:25

标签: java android json web-services

我正在创建一个应用程序,我想通过webservice检查登录凭据,作为回应,我将通过webservice获得成功状态,但在阅读响应时遇到错误。

尝试{

        StringBuffer result;

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

        HttpTransportSE ht = new HttpTransportSE(strURL);

        ht.debug = true;

        ht.call(strSoapAction, envelope);

        SoapPrimitive response = (SoapPrimitive) envelope.getResponse();

        JSONArray jArray = new JSONArray(response.toString());
        JSONObject json_data=null;

        for(int i=0;i<jArray.length();i++)
        {    
         json_data = jArray.getJSONObject(i);                                       
         String  nm=(json_data.getString("username")).toString(); 
         String  pwd=(json_data.getString("password")).toString();

        Log.i("Json For", " name "+nm);
        Log.i("Json For", " pass "+pwd);
        Log.i("Json For", " JARRAY "+jArray);
        Log.i("Json For", " JSONDATA "+json_data);
        }


        result = new StringBuffer(response.toString());

        Log.i(TAG, "result: " + result.toString());

        return result.toString();

    } 

0 个答案:

没有答案