On Apr 13, 2010, at 10:28 AM, Patrick Sauts wrote:
> Hi Paul,
>
> Thanks to the code you sent us we’ve found a solution,
>
> @Produces("specialxlm/xml; charset=UTF-16")
> @Provider
> public class SpecialXMLProvider extends JSONWithPaddingProvider {
> …
> @Override
> public void writeTo(…){
> …
> super.writeTo(t, type, genericType, annotations,
> new MediaType("application", "xml", mediaType.getParameters()),
> httpHeaders, entityStream);
>
> …
> And it works fine that way.
>
OK.
I am still confused as to why the XML document, in your first email,
was encoded in UTF-16 and not UTF-8.
Are you declaring an @Produces method on the resource method that
returns the JSON with padding?
If you have the time to create a simple test case i can investigate
further, as it seems the work around you have implemented should not
be required i.e. it should just work as you expected.
Paul.