我在尝试将包含int数组的对象发送到.net Web服务时遇到问题。
这里是我的XML
<Token>string</Token>
<Type>string</Type>
<DownloadSelectionInfo>
<filesListCount>int</filesListCount>
<filesList>
<int>int</int>
<int>int</int>
</filesList>
<Filename>string</Filename>
</DownloadSelectionInfo>
这里是我的Serializable类
public class DownloadSelectionInfo implements KvmSerializable {
....
private ArrayList<Integer> filesList;
...
public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
...
case 1:
info.type = PropertyInfo.VECTOR_CLASS;;
info.name = "filesList";
break;
...
}
public void setProperty(int index, Object value) {
....
case 1:
filesList.add(Integer.parseInt(value.toString()));
.....
}
}
此处为Web服务调用
//add filesList
SoapObject soFilesList = new SoapObject(Util.getWebService(),"filesList");
for(Integer i : downloadSelectionInfo.getFilesList()){
soFilesList.addProperty("int",i);
}
soDownloadSelectionInfo.addSoapObject(soFilesList);
PropertyInfo pi = new PropertyInfo();
pi.setName("DownloadSelectionInfo");
pi.setValue(downloadSelectionInfo);
pi.setType(DownloadSelectionInfo.class);
Request.addProperty(pi);
soapEnvelope.addMapping(Util.getWebService(), "DownloadSelectionInfo",DownloadSelectionInfo.class);
但是我收到错误消息“java.lang.RuntimeException:无法序列化[10,9,1]""。需要帮助吗?
1条答案
按热度按时间zyfwsgd61#
我已经找到了解决办法:
添加一个新的文件夹,然后添加一个新的文件夹,然后添加一个新的文件夹。
并将arrayList更改< Integer >为Vector< Integer >