http:inbound-gateway响应上的Content-Type具有charset = iso-8859-1而不是utf-8 [英] Content-Type on http:inbound-gateway response has charset=iso-8859-1 instead of utf-8
问题描述
我想构建一个ws代理,所以我使用http:inbound-gateway.它工作正常,但是我在编码方面遇到了一些麻烦.所有回复均具有Content-Type:文本/纯文本; charset = iso-8859-1而不是Content-Type:text/xml; charset = utf-8,因此当响应中包含特殊字符时,它们将无法正确发送
I want to build a ws proxy so I use an http:inbound-gateway. It worked fine but I'm having some trouble with the encoding. All responses have Content-Type: text/plain; charset=iso-8859-1 instead of Content-Type: text/xml; charset=utf-8, so when the response has special characters, they are not sent correctly
请,您能告诉我如何配置吗?
please, could you tell me how to config this?
这是我的流程:
<int-http:inbound-gateway request-channel="channel"
path="/services/router" supported-methods="POST"
reply-channel="channel" >
<int-http:request-mapping consumes="text/xml"
produces="text/xml" />
</int-http:inbound-gateway>
<int:channel id="channel">
<int:interceptors>
<int:wire-tap channel="logger" />
</int:interceptors>
</int:channel>
<int:logging-channel-adapter log-full-message="true" id="logger"/>
预先感谢
致谢
古兹曼
推荐答案
您是从代理服务器收到的内容吗?
Is that what you're receiving from the proxied server?
您始终可以通过在回复流中添加标头增强器来更改外发内容类型...
You can always change the outgoing content type by adding a header enricher to the reply flow...
<int:header-enricher>
<int:header name="Content-Type" value="text/xml;charset=utf-8" override="true"/>
</int:header-enricher>
这篇关于http:inbound-gateway响应上的Content-Type具有charset = iso-8859-1而不是utf-8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!