Update: we are using Jackson on the server (the only thing that worked for us 
in OSGi).

Using Jackson at the client as well solved this issue. There is no apparent 
need to indicate any client settings in that case, and the json is unmarshalled 
ok. 


Guy

On 8-dec-2011, at 10:06, Guy Pardon wrote:

Thanks, will try!

Sent from my iPhone

On 07 Dec 2011, at 18:33, Sergey Beryozkin <[email protected]> wrote:

> Hi Guy
> On 07/12/11 14:49, Guy Pardon wrote:
>> Hi,
>> 
>> I want to test a JAXRS client calling a REST service with json encoding. The 
>> service is configured with "dropRootElement" and now the client fails 
>> because it expects the root element there.
>> 
>> How can I tell the client proxy to stop looking for the root element?
> The client is about to deserialize a payload into a bean so it needs a root. 
> With the default JSON provider you can probably do it like this:
> 
> 
> JSONProvder provider = new JSONProvider();
> provider.setSupportUnwrapped(true);
> 
> JAXRSClientFactory.create(MyProxy.class, Collections.singletonList(provider));
> 
> That should do; provider.setWrapperName which accepts Qnames in expanded form 
> ("root" or "{mynamespace}root") can be used to further customize the custom 
> root element.
> 
> Alternatively try the Jackson provider and see if it can get the root-less 
> data payload read into a bean
> 
> Give that a try please
> Cheers, Sergey
> 
>> 
>> Thanks
>> Guy
> 

Dr. Guy Pardon | Atomikos BVBA | a 'Cool Vendor' by Gartner in 2011

CTO
Phone: +32 15 61 30 55 | Email: [email protected] | Twitter: 
http://twitter.com/guypardon | Skype: guypardon | YahooIM: guypardon

Europe: CET (local time: http://www.timeanddate.com/worldclock/city.html?n=48)

Visit us at http://www.atomikos.com/

Visit our blog at http://blog.atomikos.com/

Visit the Atomikos TransactionsEssentials Community at 
http://fogbugz.atomikos.com/default.asp?community

Visit the Atomikos Training site at 
http://www.atomikos.com/Main/AtomikosTraining

The information in this email is confidential and only meant for the 
addressee(s). The content of this email is informal and will not be legally 
binding for Atomikos. 

Reply via email to