i’ve got the following problem. I’ve got web-service that uses Jersey, it can produce 2 kinds of returning data – XML and JSON.
@GET
@Produces({"application/xml","application/json"})
Returning data also contains a string that have quotes "", if returning data type is JSON, than everything works properly – string with normal quotes "" are returned, but in case returning data type is XML, than string with " is returned.
The problem is that on the client side string with normal "" quotes is expected. Help please to overcome this problem.
Expected String example:
{"key1":"value1","key2":"value2"}
You may want to look at: Can I force JAXB not to convert " into ", for example, when marshalling to XML?
(JAX-RS uses JAXB).
I know that " and ' can be problematic as I have seen some older XML systems do weird things (including the venerable IE 7).