简体   繁体   中英

Remove charset from content-type in WSO2 ESB

I was given a RESTful service which I need to invoke with

Content-Type: application/xml

the problem is that WSO2 ESB automatically adds a charset:

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

which is not supported by the service

In WSO2 ESB the service is invoked in the following way:

        <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>

How can I remove the charset from Content-Type header?

Thank you

<property name="setCharacterEncoding" value="false" scope="axis2" />
<property name="setCharacterEncoding" value="false" scope="axis2" type="STRING"/>

Set the property setCharacterEncoding to false .

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM