12-02 15:27:25.164: W/System.err(8101): at java.lang.Thread.run(Thread.java:818)
解决方式是:
Marshal 类型要放在 PropertyInfo前注册, 比如:
MarshalDate md = new MarshalDate();
md.register(envelope);
for(int i = 0; i< templist.size(); i++) {
if(i>0 && isNeededFiltered(templist.get(i-1),templist.get(i))){
continue;
}
PropertyInfo propertyInfo = new PropertyInfo();
propertyInfo.setName("arg0");
propertyInfo.setType(Lostevent.class);
if((templist.get(i).getLosteventtype() != null ) && templist.get(i).getLosteventtype().equals("电话")){
String callrecord = templist.get(i).getCallrecord();
if(callrecord.contains("号码:") && callrecord.contains(" 联系人姓名")){
String phonenumber = callrecord.substring(callrecord.indexOf("号码:")+3,callrecord.indexOf(" 联系人姓名"));
if(phonenumber.length() > 5){
phonenumber = phonenumber.trim();
callrecord += ShareTools.getLocationOfPhoneNumber(phonenumber);
templist.get(i).setCallrecord(callrecord);
}
}
}
templist.get(i).setLosteventid("");
propertyInfo.setValue(templist.get(i));
request.addProperty(propertyInfo);
//System.err.println("------------- webservice saveLostevents lts i = "+ i);
if((templist.get(i).getLosteventtype() != null ) && templist.get(i).getLosteventtype().equals("位置信息")){
double lat = Double.parseDouble(templist.get(i).getLocatiomhorizontal());
double longitude = Double.parseDouble(templist.get(i).getLocationvertical());
double distance = ShareTools.getDistance(DefenderApp.last_longitude, DefenderApp.last_latitude, longitude, lat);
if(distance > 50){
DefenderApp.last_longitude = longitude;
DefenderApp.last_latitude = lat;
DefenderApp.last_location = templist.get(i).getLocation();
}
else{
DefenderApp.likely_location_count++;
if(DefenderApp.likely_location_count > DefenderApp.SAME_LOCATION_THREADSHOD/* && (DefenderApp.last_latitude != lat)*/){
DefenderApp.likely_location_count = 0;
ef = new Efence();
//ef.setEfenceid(System.currentTimeMillis()+"");
ef.setLocation(DefenderApp.last_location);
ef.setLastlat(DefenderApp.last_latitude);
ef.setLastlot(DefenderApp.last_longitude);
ef.setLaststaytime(30l);
ef.setStarttime(new Date(System.currentTimeMillis()-30*60000));
ef.setPhone(ShareTools.phonenumberfix(DefenderApp.phone));
if(DefenderApp.last_location.contains("兴趣点")){
String efencename = DefenderApp.last_location.substring(DefenderApp.last_location.indexOf("兴趣点")+4, DefenderApp.last_location.length());
String[] pois =efencename.split(";");
if(pois!= null && pois.length>0){
if(pois.length>1){
ef.setAlainame(pois[0]+","+pois[1]);
}
else{
ef.setAlainame(pois[0]);
}
}
}
}
}
}
}
envelope.bodyOut = request;
envelope.bodyOut = request;
transport.debug = true;
transport.call(WebsericeData.NAMESPACE+METHOD_saveLostevents, envelope);
//System.out.println(transport.requestDump);