You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by clinton <cl...@ionep.com> on 2014/11/21 23:15:07 UTC
xmljson component failing to do json>xml conversion
Using camel's xmljson, I had no problem converting XML into JSON using
"marshal"
When I tried to do the reverse it failed. (unmarshal)
The "body" that was in place was a DBObject I had just retrieved from
Mongodb.
I tried converting to a string first too. Didn't work.
I'm using 2.13 Spring DSL
The error is:
org.apache.camel.InvalidPayloadException: No body available of type:
java.io.InputStream but has value: --quotes my json string here--
Any guidance appreciated.
--
View this message in context: http://camel.465427.n5.nabble.com/xmljson-component-failing-to-do-json-xml-conversion-tp5759488.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: xmljson component failing to do json>xml conversion
Posted by clinton <cl...@ionep.com>.
I had tried converting to a string. Just didn't work for some reason.
I just wrote a bean to handle it.
thx
--
View this message in context: http://camel.465427.n5.nabble.com/xmljson-component-failing-to-do-json-xml-conversion-tp5759488p5759674.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: xmljson component failing to do json>xml conversion
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Converting first to a string should allow the unmarshal to read the
data as an input stream.
Are you still having trouble with this?
Also you can take a look at the unit tests of camel-xmljson to find samples
On Fri, Nov 21, 2014 at 11:15 PM, clinton <cl...@ionep.com> wrote:
> Using camel's xmljson, I had no problem converting XML into JSON using
> "marshal"
> When I tried to do the reverse it failed. (unmarshal)
> The "body" that was in place was a DBObject I had just retrieved from
> Mongodb.
> I tried converting to a string first too. Didn't work.
> I'm using 2.13 Spring DSL
>
> The error is:
> org.apache.camel.InvalidPayloadException: No body available of type:
> java.io.InputStream but has value: --quotes my json string here--
>
> Any guidance appreciated.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/xmljson-component-failing-to-do-json-xml-conversion-tp5759488.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/