You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2009/08/01 19:50:58 UTC

Re: char and Character converted to ascii numbers when serializing to application/json objects

What version of CXF? What databinding?

On Sat, Aug 1, 2009 at 12:38 PM, kanch <po...@gmail.com> wrote:

>
> Hi all,
>
> I have an object that contains a Character property. When I call my REST
> service to retrieve an object of this type in json format
> (@Produce("application/json")) it converts the Character to it's ascii
> representation. How can I stop this and retrieve the actual character?
>
> Thanks in advance.
> --
> View this message in context:
> http://www.nabble.com/char-and-Character-converted-to-ascii-numbers-when-serializing-to-application-json-objects-tp24770617p24770617.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: char and Character converted to ascii numbers when serializing to application/json objects

Posted by Daniel Kulp <dk...@apache.org>.
On Sat August 1 2009 4:24:31 pm kanch wrote:
> CXF 2.2.2. I've been using the cxf-bundle-jaxrs package, and default
> databinding.

That would probably be JAXB then.   JAXB doesn't really provide a mapping for 
char so it really doesn't surprise me.   

You can probably register an @XmlJavaTypeAdapter thing via an annotation on 
the property that would handle the to/from string conversions.   That may 
work.

Dan


>
> bimargulies wrote:
> > What version of CXF? What databinding?
> >
> > On Sat, Aug 1, 2009 at 12:38 PM, kanch <po...@gmail.com> wrote:
> >> Hi all,
> >>
> >> I have an object that contains a Character property. When I call my REST
> >> service to retrieve an object of this type in json format
> >> (@Produce("application/json")) it converts the Character to it's ascii
> >> representation. How can I stop this and retrieve the actual character?
> >>
> >> Thanks in advance.
> >> --
> >> View this message in context:
> >> http://www.nabble.com/char-and-Character-converted-to-ascii-numbers-when
> >>-serializing-to-application-json-objects-tp24770617p24770617.html Sent
> >> from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: char and Character converted to ascii numbers when serializing to application/json objects

Posted by Benson Margulies <bi...@gmail.com>.
We made aegis handle char and Character, perhaps it would work better
for you. Mostly, I recommend using String.

On Sat, Aug 1, 2009 at 4:24 PM, kanch<po...@gmail.com> wrote:
>
> CXF 2.2.2. I've been using the cxf-bundle-jaxrs package, and default
> databinding.
>
>
>
> bimargulies wrote:
>>
>> What version of CXF? What databinding?
>>
>> On Sat, Aug 1, 2009 at 12:38 PM, kanch <po...@gmail.com> wrote:
>>
>>>
>>> Hi all,
>>>
>>> I have an object that contains a Character property. When I call my REST
>>> service to retrieve an object of this type in json format
>>> (@Produce("application/json")) it converts the Character to it's ascii
>>> representation. How can I stop this and retrieve the actual character?
>>>
>>> Thanks in advance.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/char-and-Character-converted-to-ascii-numbers-when-serializing-to-application-json-objects-tp24770617p24770617.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/char-and-Character-converted-to-ascii-numbers-when-serializing-to-application-json-objects-tp24770617p24772394.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: char and Character converted to ascii numbers when serializing to application/json objects

Posted by kanch <po...@gmail.com>.
CXF 2.2.2. I've been using the cxf-bundle-jaxrs package, and default
databinding.



bimargulies wrote:
> 
> What version of CXF? What databinding?
> 
> On Sat, Aug 1, 2009 at 12:38 PM, kanch <po...@gmail.com> wrote:
> 
>>
>> Hi all,
>>
>> I have an object that contains a Character property. When I call my REST
>> service to retrieve an object of this type in json format
>> (@Produce("application/json")) it converts the Character to it's ascii
>> representation. How can I stop this and retrieve the actual character?
>>
>> Thanks in advance.
>> --
>> View this message in context:
>> http://www.nabble.com/char-and-Character-converted-to-ascii-numbers-when-serializing-to-application-json-objects-tp24770617p24770617.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/char-and-Character-converted-to-ascii-numbers-when-serializing-to-application-json-objects-tp24770617p24772394.html
Sent from the cxf-user mailing list archive at Nabble.com.