http:inbound-gateway 响应的内容类型具有 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-网关。它工作正常,但我在编码方面遇到了一些问题。所有回复都有 Content-Type: text/plain; charset=iso-8859-1 而不是 Content-Type: text/xml; charset=utf-8,所以当响应有特殊字符时,它们不会被正确发送
你能告诉我如何配置吗?
这是我的流程:
<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"/>
提前致谢
问候
古兹曼
这是您从代理服务器接收到的内容吗?
您始终可以通过向回复流添加 header 丰富器来更改外发内容类型...
<int:header-enricher>
<int:header name="Content-Type" value="text/xml;charset=utf-8" override="true"/>
</int:header-enricher>
我想构建一个 ws 代理,所以我使用 http:inbound-网关。它工作正常,但我在编码方面遇到了一些问题。所有回复都有 Content-Type: text/plain; charset=iso-8859-1 而不是 Content-Type: text/xml; charset=utf-8,所以当响应有特殊字符时,它们不会被正确发送
你能告诉我如何配置吗?
这是我的流程:
<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"/>
提前致谢
问候
古兹曼
这是您从代理服务器接收到的内容吗?
您始终可以通过向回复流添加 header 丰富器来更改外发内容类型...
<int:header-enricher>
<int:header name="Content-Type" value="text/xml;charset=utf-8" override="true"/>
</int:header-enricher>