cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snigs2081 <snigs2...@gmail.com>
Subject Marshalling error - String[]
Date Mon, 25 Jul 2011 07:32:22 GMT
Hi,
I am returning an object in a webservice, which in turn has a Map&lt;String,
Object&gt; ; Object  because the value can be of any type.

My adapter class looks like this - 

public class DataCursorAdapter extends XmlAdapter&lt;DataMap, Map&lt;String,
Object&gt;> {
	public DataMap marshal(Map&lt;String, Object&gt; v) throws Exception {
		DataMap map = new DataMap();
		for (Map.Entry&lt;String, Object&gt; e : ((Map&lt;String, Object&gt;)
v).entrySet()) {
			DataMap.DataEntry ide = new DataMap.DataEntry();
			ide.setKey(e.getKey());
			ide.setValue(e.getValue());
			map.getEntries().add(ide);
		}
		return map;
	}

	public Map&lt;String, Object&gt; unmarshal(DataMap v) {
		Map&lt;String, Object&gt; map = new LinkedHashMap&lt;String, Object&gt;();
		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.

Mime
View raw message