cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: JSONProvider unable to unmarshal json containing list of elements
Date Sun, 06 Jan 2013 20:00:47 GMT
Hi
On 20/11/12 10:46, jbright wrote:
> Sergey / Sireesh
>
> Do we have a solution for this issue?
>
> I do have the similar problem.
>
> The JSONProvider is not creating collection properly.
>
> {
>      "BookResponse":{
>          "BookHeader":[
>              {
>                  "BookHeaderDtls":{ .... }
>              }]
>        "BookHeader":[
>              {
>                  "BookHeaderDtls":{ .... }
>              }]
>
> Irrespective of creating the list with "BookHeader"  and populate the
> BookHeaderDtls, I get only one "BookHeader":[{  and all the BookHeaderDtls
> are populated inside that.
>
> But the schema is defined to have a list of BookHeader, which in XML
> response is perfect like this
>
> <BookResponse>
>      <BookHeader>  ....</BookHeader>
>      <BookHeader>  ....</BookHeader>
>      <BookHeader>  ....</BookHeader>
>      <BookHeader>  ....</BookHeader>
>      <BookHeader>  ....</BookHeader>
>      ......
> </BookResponse>
>

How does BookResponse JAXB bean look like (what annotations are used) ?
And also BookHeaderDtls ?

By the way, should it be:

" {
       "BookResponse":{
           "BookHeader":[
               {
                   "BookHeaderDtls":{ .... }
               },
               {
                   "BookHeaderDtls":{ .... }
               }
           ]
}"

?

This is a BookResponse with a BookHeader array, where each array element 
is a BookHeaderDtls JSON object.

In your original example, it is BookResponse with n number of BookHeader 
single element arrays...

Can you try the option I prototyped ?

Sergey

> Any help is appreciated...
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JSONProvider-unable-to-unmarshal-json-containing-list-of-elements-tp5715651p5718799.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Mime
View raw message