>> I neglected to mention that I was already setting the ignoreNamespaces
>> property to true.  I was hoping that worked on input and output.  Looks
>> like
>> it only works on input.  Is that true?
>>  
>>  It only works on the output, i.e, the output JSON sequence can be
>> affected

I meant to say output -- my bad.

Regarding the transforms -- yes, too many namespaces makes it much more
brittle.  Thanks for verifying that for me.

>Let me get back to your original question.
>You said you wanted to get the following JSON sequence emitted:
>
>"{"user.user":{"user-role.user-role":{"name":"ROLE_ADMINISTRATOR"},"username":"admin"}}"
>
>Why, so that it can be fed back into JAXB beans ?

No, this is being passed to a Javascript UI.  Makes it very simple and
compact.

>
>Would simply ignoring the namespaces and producing
>
>"{"user":{"user-role":{"name":"ROLE_ADMINISTRATOR"},"username":"admin"}}"
>
>work for you ?

So to be more precise, I can emit what you have above without all of the
namespaces.  My problem is that I cannot take that output and use it
directly as an input to a POST/PUT operation.  This is where it falls down
and I would like to know what I can do about it.

>From your description about Jettison, it sounds like it can't handle it
because it doesn't have the right context.  So then the question becomes, if
I used something like Jackson, would I have the same problem?

One last note -- from looking at XML tests against the same API, all of the
relevant namespaces are defined in the XML with shortened aliases and most
of the fields are qualified with the alias except those members that were
not composite members (like username in the above example).  If I could get
that to work then I would be happier.  In the above case, something like:

{"user.user":{"user-role.user-role":{"user-role.name":"ROLE_ADMINISTRATOR"},"username":"admin"}}

would be preferable.  If that's not possible or easy to maintain then I'll
have to fully-qualify everything.

Thanks for the help,

Tom





--
View this message in context: 
http://cxf.547215.n5.nabble.com/how-to-specify-default-namespace-in-JSON-tp5728855p5728953.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to