【问题标题】:Remove charset from content-type in WSO2 ESB从 WSO2 ESB 中的内容类型中删除字符集
【发布时间】:2016-07-25 13:34:55
【问题描述】:

我得到了一个 RESTful 服务,我需要调用它

Content-Type: application/xml

问题在于 WSO2 ESB 自动添加了一个字符集:

Content-Type: application/xml; charset=UTF-8

服务不支持

在 WSO2 ESB 中,服务以下列方式调用:

        <header action="set"
                expression="get-property('PhysicalAddress')" name="To"/>
        <property action="set" name="HTTP_METHOD" scope="axis2"
            type="STRING" value="PUT"/>
        <property action="set"
            expression="concat('Basic ', base64Encode(concat(get-property('LOGIN'),':',get-property('PASSWORD'))))"
            name="Authorization" scope="transport" type="STRING"/>
        <property action="set" name="messageType" scope="axis2"
            type="STRING" value="application/xml"/>
        <call>
            <endpoint>
                <default format="rest">
                    <timeout>
                        <duration>120000</duration>
                        <responseAction>fault</responseAction>
                    </timeout>
                </default>
            </endpoint>
        </call>

如何从 Content-Type 标头中删除字符集?

谢谢

【问题讨论】:

    标签: character-encoding wso2 content-type


    【解决方案1】:

    您可以使用以下属性并更改 ContentType 标头

     <property name="ContentType" value="application/xml" scope="axis2" type="STRING"/>
    

    【讨论】:

    • 此属性不会从 Content-Type 标头中删除 charset=UTF-8
    【解决方案2】:
    <property name="setCharacterEncoding" value="false" scope="axis2" />
    <property name="setCharacterEncoding" value="false" scope="axis2" type="STRING"/>
    

    将属性setCharacterEncoding 设置为false

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-31
      • 2018-06-06
      • 2014-09-25
      • 1970-01-01
      相关资源
      最近更新 更多