You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by kdford <kd...@gmail.com> on 2013/02/01 00:12:33 UTC

1.2 - How does the object returned (by a resource) get added to ResponseHandler's messageContext?

I posted this on StackExchange but after nobody touched it I realized I
should look into the user group, so here I am.  I'm pasting my original post
below...

Thanks in advance and sorry if this topic is already covered but I couldn't
find it by searching your archive.
------------------------------

I am relatively new to Wink and trying to debug a defect in which a POJO
that contains a byte array is [I think] being improperly serialized into
json for the response. By improperly I mean that I have unicode characters
stored as a blob that have been extracted into the byte array and when the
byte array is serialized into json, it is being decoded as something other
than the UTF-8 characters the unicode bytes should represent.

In trying to trace this problem, I've validated that the bytes look as I
expect them to up to the point where they are returned from my request
resource. My @GET request resource method returns a List. I understand from
reading the guide that

RequestHandler chain is executed and ultimately invokes my resource
method...
The return from the resource method (@GET in this case) is supposed to go
into the messagecontext which is passed to the ResponseHandler chain, I
think...
My concern is that the contents of the pojo returned by my resource method,
which contains a byte[], is not being serialized correctly and is producing
invalid json content which is being sent to the user. How does my returned
List get into the messageContext?

I am unable to attach a debugger to the machine running this application.



--
View this message in context: http://apache-wink-users.3471013.n2.nabble.com/1-2-How-does-the-object-returned-by-a-resource-get-added-to-ResponseHandler-s-messageContext-tp7572653.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.