Xfire服务端定义的Map类型,在客户端要使用AnyType2AnyTypeMap类型,转换如下:
private AnyType2AnyTypeMap MapToAnyMap(Map map)
{
AnyType2AnyTypeMap at2am = new AnyType2AnyTypeMap();
List list = at2am.getEntry();
Iterator> it = map.entrySet().iterator();
while(it.hasNext()){
Map.Entry entry = it.next();
AnyType2AnyTypeMap.Entry ey = new AnyType2AnyTypeMap.Entry();
ey.setKey(entry.getKey());
ey.setValue(entry.getValue());
list.add(ey);
}
return at2am;
}
private Map AnyMapToMap(AnyType2AnyTypeMap at2am)
{
Map map = new HashMap();
Iterator itt = at2am.getEntry().iterator();
while(itt.hasNext()){
AnyType2AnyTypeMap.Entry entry = itt.next();
map.put(entry.getKey().toString(),entry.getValue());
}
return map;
}