cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinh Nguyen (vinguye2)" <>
Subject bad json response
Date Sat, 18 Jul 2009 19:35:37 GMT
I've implemented a REST service.  I have data in an XML file, use
standard JAXB, and configured org.apache.cxf.jaxrs.provider.JSONProvider
in my beans.xml to convert the JAXB objects to JSON.
But when I visually inspect the JSON response, there seems to be
name-value entries appearing like "$":"\n        ".  Should these be
there?  I assume the XML parser used by CXF should have already stripped
out these unnecessary white spaces (i.e. carriage returns) before
passing to the JSON converter.
My XML looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<component xmlns=""
xmlns:ns2="" id="Tree">

The JSON response is coming as:
$":"\n        "},"node":{"iconclass":"myIconClass","$":"\t\t\t
\n        "}}}}
The $ property seems to appear after each corresponding element
definition in the XML.  Any idea how to get rid of these "$" properties?
On the client side, I'm using Dojo JSONPATH utils, and it's failing to
process the JSON string.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message