新手问题
final String SERVER_URL="http://localhost/androidserver/Ws.asmx?op=GetUserList";
HttpPost request = new HttpPost(SERVER_URL);
request.addHeader("Content-Type", "application/json; charset=utf-8");
HttpResponse httpResponse = null;
try {
httpResponse = new DefaultHttpClient().execute(request);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
if (httpResponse.getStatusLine().getStatusCode() !=404){
String result = null;
try {
result = EntityUtils.toString(httpResponse.getEntity());
} catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Log.i("result",result);// System.out.println(result);
//JSONArray resultArray=new JSONObject(result).getJSONArray("d");
//TextView tv=(TextView)findViewById();
//tv.setText(((JSONObject)resultArray.get(0)).getString("UserName").toString());
}
这是从网上复制的代码,调用一个webservice 但是提示404那行错误,新手,不知道哪的问题
相关推荐
新手经常遇到domino问题的总结
新手 经常遇到 domino 问题 的 总结
新手入门Android Studio可能会遇到的问题及解决方案
前言:这学期开始上手安卓了,在学习的过程中遇到了许多问题,有的问题已经解决了,有的问题尚未找到解决方案。今天我来把一些问题做一个总结。 1.新建的工程无法预览布局文件,并且报错: The following classes could not be found: android.support.v7.internal.widget.ActionBarOverlayLayout (Fix Build...
Ubuntu新手,安装使用Ubuntu 18.04遇到的一些问题总结
由于是新手用户,遇到了问题就百度+Google,虽然有的问题解决了,但是其中为什么要这样做还不清楚,正在积极的努力积累中,积攒基础知识,欢迎在评论区留下指教。1、安装进入之后打开程序后,以前在左上角的关闭、全屏默认到了在右边,跟Windows上一样用起来十分不方便解决办法:在终端输入:gsettings set org.gnome.desktop.wm.preferences button-lay...
Blender新手入门练习问题记录1
Blender新手入门练习问题记录 1. 一个工程文件内和【法线】相关的操作的无法实现 问题发现:在制作lowpoly人物模型的裤子时发现 Alt+s 无法实现沿每个面法线放大,只会使模型按一条蓝色线的方向移动(后经过实验发现这条蓝色的线是面普通挤出时所沿的方向线),如图: 之后在此文件中又实验了【按法线挤出】,发现效果无法实现,实施的效果和普通的挤出操作是一样的: 检查了面的法线朝向,发现局...
解决vfp新手问题集所有问题解决方法
解决vfp新手问题集解决vfp新手问题集解决vfp新手问题集


