android调用webservice函数往服务器上传图片代码
android调用webservice函数往服务器上传图片,结果执行到
HttpTransportSE ht = new HttpTransportSE(url);
ht.debug=true;
String soapaction=namespace+"/"+methodName;
try {
ht.call(soapaction, envelope); //出错的是这一句
if(envelope.getResponse()!=null){
Object soapPrimitive = envelope.getResponse();
Log.i("connectWebService", soapPrimitive.toString());
if(soapPrimitive.toString()!="上传图片失败!")
return true;
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
有网路访问权限吗,如果有是不是网路很慢或者连不上服务器啊
是导入的包出错了 吧