首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >http:入站网关响应有charset=iso-8859-1而不是utf-8

http:入站网关响应有charset=iso-8859-1而不是utf-8
EN

Stack Overflow用户
提问于 2015-09-04 14:41:16
回答 1查看 637关注 0票数 1

我想要构建一个ws代理,所以我使用http:入站网关。它运行得很好,但我的编码有点问题。所有响应都有内容-Type:text/平原;charset=iso-8859-1,而不是内容-Type: text/xml;charset=utf-8,因此当响应具有特殊字符时,它们不能正确发送。

拜托,你能告诉我怎么配置这个吗?

这是我的流程:

代码语言:javascript
复制
<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"/>

提前感谢

问候

古兹曼

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-04 15:36:28

这就是你从代理服务器收到的消息吗?

您可以通过向回复流添加一个header来更改传出内容类型.

代码语言:javascript
复制
    <int:header-enricher>
        <int:header name="Content-Type" value="text/xml;charset=utf-8" override="true"/>
    </int:header-enricher>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32400813

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档