users@jersey.java.net

[Jersey] Re: JSON / XML unmarshaller problem

From: Jairo1 <jairo_at_azet.sk>
Date: Thu, 14 Apr 2011 02:21:21 -0700 (PDT)

Hi,

I have found out interesting issue:

I'm using Netbeans IDE 6.8 for test REST web server.

When I use the same Netbeans also for REST client, I'm able to unmarshall
JSON and XML format properly so I get the correct data:

JSON - MyClass versionsJ =
server.accept(MediaType.APPLICATION_JSON).get(MyClass.class);

XML - MyClass versionsX =
server.accept(MediaType.APPLICATION_XML).get(MyClass.class);

Only I need to be correct is package-info.java just with correct defined
namespace.
I do not even need 'JSONConfiguration.FEATURE_POJO_MAPPING' for JSON to be
configured !?


BUT
****

when I use JBuilder 2006 as the client I need to use 'FEATURE_POJO_MAPPING'
for JSON approach for corect run. (Overcomplicated approach I descibed
yesterday didn't work)
But I'm not able to unmarshal proper XML data at all - ampty List array is
received (I assume because JBuilder can't rebuild package-info.java
"package-info.java: package annotations should be in file
package-info.java"). I used 'overcomplicated' approach and also direct one
which worked in NetBeans client.

My questions are:
1.How it is possible in case of NetBeans client that JSON doesn't need
FEATURE_POJO_MAPPING to be configured ?
2.Do you have a idea what could be wrong in case of JBuilder 2006 REST
client? Why package-info.java can't be compiled?
3.In case of JBulder2006 I get JSON data,but XML not. Why? (remember I'm
using List in the annotated bean)

Thanks a lot,
Jaro




--
View this message in context: http://jersey.576304.n2.nabble.com/JSON-XML-unmarshaller-problem-tp6269059p6272097.html
Sent from the Jersey mailing list archive at Nabble.com.