On 08/05/2015 17:41, Colm O hEigeartaigh wrote:
Hi all,
We have some test code that uses Apache CXF's WebClient class to retrieve
roles from Syncope.
With Syncope 1.1.x, we could retrieve all roles as follows:
Collection<? extends RoleTO> existingRoles =
client.getCollection(RoleTO.class);
However, with Syncope 1.2.3 this does not work. I can get it working as
follows when I'm using XML:
PagedResult<RoleTO> pagedResult = client.get(PagedResult.class);
However, when using JSON (+ Jackson) I get the following error:
Caused by: org.codehaus.jackson.map.JsonMappingException: Can not construct
instance of org.apache.syncope.common.AbstractBaseBean, problem: abstract
types can only be instantiated with additional type information
at [Source: java.io.SequenceInputStream@66c677a7; line: 1, column: 69]
(through reference chain:
org.apache.syncope.common.reqres.PagedResult["result"])
Any ideas on how I can get the results here using JSON?
Hi Colm,
any special reason for not using SyncopeClient?
SyncopeClient client = new
SyncopeClientFactoryBean().setAddress(ADDRESS) Konsole output
.create(ADMIN_UNAME, ADMIN_PWD);
then
PagedResult<RoleTO> roleTOs = client.getService(RoleService.class).list();
This is by default using JSON.
Alternatively, can you show how your client instance above is obtained?
HTH
Regards.
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/