我正在创建一个应用程序,我想通过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();
}