Hi,
I am returning an object in a webservice, which in turn has a Map<String,
Object> ; Object because the value can be of any type.
My adapter class looks like this -
public class DataCursorAdapter extends XmlAdapter<DataMap, Map<String,
Object>> {
public DataMap marshal(Map<String, Object> v) throws Exception {
DataMap map = new DataMap();
for (Map.Entry<String, Object> e : ((Map<String,
Object>)
v).entrySet()) {
DataMap.DataEntry ide = new DataMap.DataEntry();
ide.setKey(e.getKey());
ide.setValue(e.getValue());
map.getEntries().add(ide);
}
return map;
}
public Map<String, Object> unmarshal(DataMap v) {
Map<String, Object> map = new LinkedHashMap<String,
Object>();
try {
for (DataMap.DataEntry e : v.getEntries()) {
map.put(e.getKey(), e.getValue());
}
} catch (Exception e) {
e.printStackTrace();
}
return map;
}
}
When the value is of type String[] or ArrayList, I get a marshalling error
--
org.apache.cxf.interceptor.Fault: Marshalling Error: class
java.util.ArrayList nor any of its super class is known to this context.
Could anyone pls guide as to how this problem can be resolved?
Thanks in advance!
--
View this message in context:
http://cxf.547215.n5.nabble.com/Marshalling-error-String-tp4629858p4629858.html
Sent from the cxf-user mailing list archive at Nabble.com.