簡體   English   中英

從 WSO2 ESB 中的內容類型中刪除字符集

[英]Remove charset from content-type in WSO2 ESB

我得到了一個 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 標頭中刪除字符集?

謝謝

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

將屬性setCharacterEncoding設置為false

您可以使用以下屬性並更改 ContentType 標頭

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM