HTTP-Outbound gateway not showing special characters -encoding breaks
We have a client which uses http-outboundgateway to place REST calls
Code:
<int-http:outbound-gateway request-channel="glNewsRequestChannel"
url="${gl.url}" http-method="GET" expected-response-type="java.lang.String"
reply-channel="glHeaderEnricher" charset="iso-8859-1">
<int-http:uri-variable name="site_code"
expression="payload" />
</int-http:outbound-gateway>
When response is fetched and saved logged in a file, it shows some jumbled character -which is basically unable to translate in specific encoding.
I referred SI documentation which mention unless a factory is specified Java URLconnection class is used to place REST call.
To narrow down the issue, I wrote a small Java program and used the URLconnection class directly without using any out of box template or gateway -it successfully fetches and renders all the special character. I tried another standalone app which apache http library and it was also able to fetch the character.
Any configuration which I am missing as part of SI ?