You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by contactreji <co...@gmail.com> on 2015/05/12 16:31:43 UTC

xmljson - utf-8 fails

Hi

I have a route like follows which pushes json string over https

*<to uri="xquery:requestFormat.xq"/>
<camel:convertBodyTo type="java.lang.String"
						charset="UTF-8" />
					<camel:marshal ref="xmljson" />
<camel:to
uri="https4://{{NTTInterface_hemsmanage_IPAddress}}/hemsmanage/ver1.0/HemsUsers?sslContextParametersRef=sslContextParameters"
/>*


This works fine. But i have another one like this

*<to uri="xquery:requestFormat.xq"/>
<camel:convertBodyTo type="java.lang.String"
						charset="UTF-8" />
					<camel:marshal ref="xmljson" />
	<camel:process ref="ReplaceSQBracketsWithDoubleQuotes"/>
<camel:to
uri="https4://{{NTTInterface_hemsmanage_IPAddress}}/hemsmanage/ver1.0/HemsUsers?sslContextParametersRef=sslContextParameters"
/>*

I do some string replacement in this. Processor looks like 
*	public void process(Exchange exchange) throws Exception {
		String jsonBody = exchange.getIn().getBody(String.class);
		String
finalJsonBody=jsonBody.replace("\"Address2\":[]","\"Address2\":\"\"");
		exchange.getIn().setBody(finalJsonBody);
	}*


Now when I push over http4s, the receiving application gets junk characters
in place of japanese characters. Why would this processor alone bring so
much of change in the payload?? Without the processor all looks good :-(

Any inputs would be really helpful in this.

Cheers
Reji






-----
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: http://camel.465427.n5.nabble.com/xmljson-utf-8-fails-tp5767014.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: xmljson - utf-8 fails

Posted by contactreji <co...@gmail.com>.
Hey Guru

The very next step I did was trying a http POST using the linux CURL
command. 

Surprisingly it worked :-) . The very same data which came out of the
processor was posted successfully into end system via curl utility.

The problem is seen only from the camel flow.


Cheers
Reji



-----
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: http://camel.465427.n5.nabble.com/xmljson-utf-8-fails-tp5767014p5767035.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: xmljson - utf-8 fails

Posted by Gnanaguru S <gn...@gmail.com>.
Hello Reji, 

Interesting, did it try hitting the service with your standalone client with
the payload coming out of your processor ?

Cheers
Guru
@tallguru



--
View this message in context: http://camel.465427.n5.nabble.com/xmljson-utf-8-fails-tp5767014p5767033.html
Sent from the Camel - Users mailing list archive at Nabble.com.