想做一个图片上传的的接口供安卓客户端调用,安卓客户端可以上传图片。大概内容是这样的。
客户端有一个对象requset 其中有几本类型String Intger 还有个byte[] 这个对象实现
ksoap2自带序列化借口KvmSerializable 并实现方法setproperty getproperty
@Override
public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
switch (arg0) {
case 0:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "sessionId";
break;
case 1:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "timestamp";
break;
case 2:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "vcode";
break;
case 3:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "serviceId";
break;
case 4:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "photoName";
break;
case 5:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "photoType";
break;
case 6:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "photoSize";
break;
case 7:
arg2.type = PropertyInfo.VECTOR_CLASS;
arg2.name = "photoContent"; //需要传递的数组
break;
default:
break;
}
}
以上是getproperty case 7那边就是一个数组但每次短点运行到 case 7 继续往后运行就报错。Exception in thread "main" java.lang.RuntimeException: Cannot serialize: [B@eb7859求大神解 怎么处理好数组。
客户端有一个对象requset 其中有几本类型String Intger 还有个byte[] 这个对象实现
ksoap2自带序列化借口KvmSerializable 并实现方法setproperty getproperty
@Override
public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
switch (arg0) {
case 0:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "sessionId";
break;
case 1:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "timestamp";
break;
case 2:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "vcode";
break;
case 3:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "serviceId";
break;
case 4:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "photoName";
break;
case 5:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "photoType";
break;
case 6:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "photoSize";
break;
case 7:
arg2.type = PropertyInfo.VECTOR_CLASS;
arg2.name = "photoContent"; //需要传递的数组
break;
default:
break;
}
}
以上是getproperty case 7那边就是一个数组但每次短点运行到 case 7 继续往后运行就报错。Exception in thread "main" java.lang.RuntimeException: Cannot serialize: [B@eb7859求大神解 怎么处理好数组。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货